Learn R Programming

echarts4r (version 0.1.1)

e_cloud: Wordcloud

Description

Draw a wordcloud.

Usage

e_cloud(e, word, freq, color, rm.x = TRUE, rm.y = TRUE, ...)

e_cloud_(e, word, freq, color = NULL, rm.x = TRUE, rm.y = TRUE, ...)

Arguments

e

An echarts4r object as returned by e_charts.

word, freq

Terms and their frequencies.

color

Word color.

rm.x, rm.y

Whether to remove x and y axis, defaults to TRUE.

...

Any other option to pass, check See Also section.

See Also

https://github.com/ecomfe/echarts-wordcloud

Examples

Run this code
# NOT RUN {
words <- function(n = 5000) {
  a <- do.call(paste0, replicate(5, sample(LETTERS, n, TRUE), FALSE))
  paste0(a, sprintf("%04d", sample(9999, n, TRUE)), sample(LETTERS, n, TRUE))
}

tf <- data.frame(terms = words(100), 
  freq = rnorm(100, 55, 10)) %>% 
  dplyr::arrange(-freq)

tf %>% 
  e_color_range(freq, color) %>% 
  e_charts() %>% 
  e_cloud(terms, freq, color, shape = "circle", sizeRange = c(3, 15))

# }

Run the code above in your browser using DataLab