@DLU, there are no stupid questions
here!
- data() is a function that loads one of the built-in data sets in the packages you have loaded. For example
suppressPackageStartupMessages(library(dplyr))
data(nasa)
nasa
#> Source: local array [41,472 x 4]
#> D: lat [dbl, 24]
#> D: long [dbl, 24]
#> D: month [int, 12]
#> D: year [int, 6]
#> M: cloudhigh [dbl[,24,12,6]]
#> M: cloudlow [dbl[,24,12,6]]
#> M: cloudmid [dbl[,24,12,6]]
#> M: ozone [dbl[,24,12,6]]
#> M: pressure [dbl[,24,12,6]]
#> M: surftemp [dbl[,24,12,6]]
#> M: temperature [dbl[,24,12,6]]
Created on 2020-01-19 by the reprex package (v0.3.0)
So, yes, Test
is in your namespace.
On to the second question, and this one will help with understanding how to read the help()
pages. Think of R
as school algebra writ large, f(x) = y.
Here f is wordcloud
and y is Test
.
Here's the function signature and the portion that describes the one thing it must have
wordcloud(words,freq,scale=c(4,.5),min.freq=3,max.words=Inf,
random.order=TRUE, random.color=FALSE, rot.per=.1,
colors="black",ordered.colors=FALSE,use.r.layout=FALSE,
fixed.asp=TRUE, ...)
Argumentswords
the words
It could be clearer. Text
has words, but not in the form that wordcloud
expects. Scrolling down to the example, it shows that words
can either be a character string or a VCorpus object
library(tm)
#> Loading required package: NLP
library(wordcloud)
#> Loading required package: RColorBrewer
my_words <- "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
class(my_words)
#> [1] "character"
data(crude)
class(crude)
#> [1] "VCorpus" "Corpus"
Created on 2020-01-19 by the reprex package (v0.3.0)
Finally, reprex
The FAQ topic includes an overview and links to how-tos: