https://github.com/chainsawriot/wordcloudrr
R to HTML5 wordcloud
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (3.4%) to scientific vocabulary
Repository
R to HTML5 wordcloud
Basic Info
- Host: GitHub
- Owner: chainsawriot
- License: mit
- Language: JavaScript
- Default Branch: master
- Size: 27.3 KB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
wordcloudrr
R to HTML5 wordcloud, with the goal to be a drop-in replacement for wordcloud::wordcloud().
install
{r}
require(devtools)
install_github("chainsawriot/wordcloudrr")
usage
```{r} require(wordcloudrr)
minimal example
wordcloudrr(c('Hello World!'), c(100))
useful example
words <- c("hello", 'ngramrr', 'chainsawriot', 'weiborr', 'hkgovrr', 'xx') freq <- c(150, 80, 500,1000, 20, 10) cols <- c('red', 'violet', 'tomato4', "wheat2", "seagreen", "royalblue") wordcloudrr(words, freq, scale=c(0.3, 0.1), cols= cols, width = 1000, height = 1000)
a practical example, modified from wordcloud::wordcloud()
data(crude) crude <- tmmap(crude, removePunctuation) crude <- tmmap(crude, function(x)removeWords(x,stopwords())) tdm <- TermDocumentMatrix(crude) m <- as.matrix(tdm) v <- sort(rowSums(m),decreasing=TRUE) d <- data.frame(word = names(v),freq=v) cc <- brewer.pal(5, "Blues")[factor(cut(d$freq, c(0 ,1, 5, 10, 30, Inf)))]
the default auto_size is quite good already, you don't need to adjust the scale
wordcloudrr(d$word,d$freq,cols = cc, shape = "circle", width = 1000, height = 650)
Customize a little to make it more attractive
wordcloudrr(d$word,d$freq,cols = cc, shape = "circle", width = 1000, height = 650, rot_per = 0.05, scale = c(0.3, 0.05), bgcolor = "#EFF3FF") ```
Owner
- Login: chainsawriot
- Kind: user
- Location: Germany
- Company: @gesistsa
- Website: http://www.chainsawriot.com
- Repositories: 241
- Profile: https://github.com/chainsawriot
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0