Create a Word Cloud From the Abstracts Associated With a Specified PubMed Search


This bit of R code will allow for the creation of a word cloud associated with the abstracts obtained via the pubmed search of a given search string.

Installation of Required Packages

# Install these packages if they are not currently installed
    if(!require('RWordPress')) install.packages('')
    if(!require('wordcloud')) install.packages('wordcloud')
    if(!require('tm')) install.packages('tm')
    if(!require('RISmed')) install.packages('RISmed')

Install my simple PubMedWordCloud library from GitHub

if(!require('devtools')) install.packages('devtools')

Creating a Word Cloud

Now, creating an word cloud for a pubmed search term is as easy as executing the following command:

PubMedWordCloud(SearchTerm="Dan Gaile OR Daniel Gaile", min.freq=3, max.words=250)

plot of chunk wordcloud

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s