

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a black and white word cloud in R?
According to Google, a word cloud is an image composed of words used in a particular text or subject, in which the size of each word indicates its frequency or importance. In R, we can create word cloud by using wordcloud function of wordcloud package. So, we have the same name of the function as the package, thus we should not get confused by it.
Loading wordcloud package and creating a wordcloud −
library("wordcloud") x<-c("tutorialspoint is one of the best free resources for online learning") wordcloud(x)
Warning messages −
- In tm_map.SimpleCorpus(corpus, tm::removePunctuation) −
transformation drops documents
- In tm_map.SimpleCorpus(corpus, function(x) tm::removeWords(x, tm::stopwords())) −
transformation drops documents
Output
Let’s have a look at another example −
y<-c("covid-19 has changed almost everything that happens around the world") wordcloud(y)
Warning messages −
- In tm_map.SimpleCorpus(corpus, tm::removePunctuation) −
transformation drops documents
- In tm_map.SimpleCorpus(corpus, function(x) tm::removeWords(x, tm::stopwords())) −
transformation drops documents
Output
- Related Questions & Answers
- How to Create a Black and White Image Using CSS
- How to create a "black and white" image with CSS?
- Create Word Cloud using Python
- Create white text with black shadow using CSS
- Plot a black-and-white binary map in Matplotlib
- How to plot a half-black and half-white circle using Matplotlib?
- How to create a scatterplot with white background and no gridlines using ggplot2 in R?
- Why do doctors wear White & Lawyers black?
- What is the difference between a white box, black box, and gray box testing?
- Differences between Black Box Testing vs. White Box Testing.
- Create a white space in HTML
- How to create a bar plot using ggplot2 with one bar having black border in R?
- Black Box Testing Vs. White Box Testing- What’s the Difference?
- How to create Microsoft Word paragraphs and insert Images in Python?
- What are the ways in which black money can be converted into white money?
Advertisements