Create a wordcloud of text. This excludes common English words ("the", "and") but you can add your own to exclude as well. This uses the wordcloud package for plotting, and you can pass other arguments to that to make the plot prettier (see ?wordcloud::wordcloud) This follows the advice from http://www.sthda.com/english/wiki/text-mining-and-word-cloud-fundamentals-in-r-5-simple-steps-you-should-know on making a word cloud

nsf_wordcloud(
  text = nsf_get_all()$abstractText,
  prune_words = c("will", "nfs"),
  max_words = 500,
  ...
)

Arguments

text

A vector of text (for example, from grants$abstractText)

prune_words

Other words you want to prune before plotting

max_words

How many words at most to plot (it picks the most frequent ones)

...

Arguments to the wordcloud function

Details

Make a word cloud of all the interesting words

Examples

grants <- load_nsf_grants(year_start=2020, year_end=2024)
#> ℹ All local files already up-to-date!
#> ℹ All local files already up-to-date!
#> ℹ All local files already up-to-date!
#> ℹ All local files already up-to-date!
#> ℹ All local files already up-to-date!
nsf_wordcloud(grants$abstractText[1:10])
#> Warning: transformations could not be fit on page. It will not be plotted.
#> Warning: experiments could not be fit on page. It will not be plotted.
#> Warning: hydromechanical could not be fit on page. It will not be plotted.
#> Warning: influences could not be fit on page. It will not be plotted.
#> Warning: sinkholes could not be fit on page. It will not be plotted.
#> Warning: understand could not be fit on page. It will not be plotted.
#> Warning: individuals could not be fit on page. It will not be plotted.
#> Warning: providing could not be fit on page. It will not be plotted.
#> Warning: signifiers could not be fit on page. It will not be plotted.
#> Warning: instrument could not be fit on page. It will not be plotted.
#> Warning: aquatic could not be fit on page. It will not be plotted.
#> Warning: fundamental could not be fit on page. It will not be plotted.
#> Warning: otherwise could not be fit on page. It will not be plotted.
#> Warning: populations could not be fit on page. It will not be plotted.
#> Warning: relatively could not be fit on page. It will not be plotted.
#> Warning: springstreams could not be fit on page. It will not be plotted.
#> Warning: commercial could not be fit on page. It will not be plotted.
#> Warning: entering could not be fit on page. It will not be plotted.
#> Warning: generate could not be fit on page. It will not be plotted.
#> Warning: processing could not be fit on page. It will not be plotted.
#> Warning: products could not be fit on page. It will not be plotted.
#> Warning: colleges could not be fit on page. It will not be plotted.
#> Warning: increasing could not be fit on page. It will not be plotted.
#> Warning: lsamp could not be fit on page. It will not be plotted.
#> Warning: mississippi could not be fit on page. It will not be plotted.
#> Warning: potential could not be fit on page. It will not be plotted.
#> Warning: preparation could not be fit on page. It will not be plotted.
#> Warning: programs could not be fit on page. It will not be plotted.
#> Warning: promote could not be fit on page. It will not be plotted.
#> Warning: region could not be fit on page. It will not be plotted.
#> Warning: resources could not be fit on page. It will not be plotted.
#> Warning: biology could not be fit on page. It will not be plotted.
#> Warning: genetic could not be fit on page. It will not be plotted.
#> Warning: group could not be fit on page. It will not be plotted.
#> Warning: roles could not be fit on page. It will not be plotted.
#> Warning: sequence could not be fit on page. It will not be plotted.
#> Warning: space could not be fit on page. It will not be plotted.
#> Warning: training could not be fit on page. It will not be plotted.

#> Warning: persistence could not be fit on page. It will not be plotted.
#> Warning: scholarships could not be fit on page. It will not be plotted.