Home » R » Wordclouds from ORCiD

Wordclouds from ORCiD

I keep seeing nice little wordclouds summarizing research profiles from different groups. I’ve played with them myself. Drawing is simple, but getting the data can be a pain. Now, with the new rorcid package that is made easy. If you don’t already have them, you need the following installed:

## install packages using the following
install.packages("devtools") # to install from github
library(devtools)
install_github("ropensci/rorcid") # to access orcid through R
install.packages(c("tm","wordcloud")) # to draw word clouds

I’ve put a few convenience functions in a gist, so do

f <- tempfile()
download.file("https://gist.githubusercontent.com/chr1swallace/d4b54bf273006ea0acc1/raw/54ddf5065a43fabba8f0414366d1853dd6b6608d/orcidcloud.R",f,method="wget")
source(f)

Then head off to ORCiD and find the id for your favourite scientist (I chose Sylvia Richardson, a Bayesian statistician and Director of the MRC Biostatistics Unit), and draw a wordcloud from their papers:

id <- "0000-0003-1998-492X"
data <- orcid_id(orcid = id, profile="works")

## extract items
years <- get.years(data[[1]])
titles <- get.titles(data[[1]])
authors <- get.authors(data[[1]],surnames=TRUE)
co.authors <- lapply(authors,setdiff,"Richardson")

## make a word cloud
make.cloud(titles)

Alternatively, the whole thing can be run at once (what can be “titles”, “years”, “authors”).

data <- orcid_id(orcid = id, profile="works")
orcid.cloud(data, what="titles")

cloud-richardson

You can play with drawing co authors similarly. I’ve tried also to group by decade, to see the changing research profile, but it needs a bit of work, I think. Grouping by decade, the one paper from the 1970s gets over prominant. For now, I dropped it, but there should be a better way of dealing with this.

use <- which(years >= 1980)
make.cloud(titles[use],by=years[use],group=10,min.freq=2)

cloud-richardson-decade

Author: Chris Wallace

Created: 2015-02-17 Tue 11:35

Emacs 24.3.1 (Org mode 8.2.10)

Validate

Advertisements

One thought on “Wordclouds from ORCiD

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s