Examples for 'snippets::cloud'


Word cloud (aka tag cloud) plot

Aliases: cloud

Keywords: interface

### ** Examples

# a really silly one
words <- c(apple=10, pie=14, orange=5, fruit=4)
cloud(words)
plot of chunk example-snippets-cloud-1
Warning in par(omar): argument 1 does not name a graphical parameter
# or with more words - take the license for example
r <- paste(readLines(file.path(R.home(),"COPYING")), collapse=' ')
r <- gsub("[\f\t.,;:`'\\\"\\(\\)<>]+", " ", r)
w <- tolower(strsplit(r, " +")[[1]])
cloud(sqrt(table(w)))
plot of chunk example-snippets-cloud-1
Warning in par(omar): argument 1 does not name a graphical parameter
# remove infrequent words
wt <- table(w)
wt <- log(wt[wt > 8])
cloud(wt, col = col.br(wt, fit=TRUE))
plot of chunk example-snippets-cloud-1
Warning in par(omar): argument 1 does not name a graphical parameter

[Package snippets version 0.1-3 Index]