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

Overview

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('dev.tools')
    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')
devtools:::install_github("dpgaile/PubMedWordCloud")
library(PubMedWordCloud)

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