- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 Articles
- How to create a "black and white" image with CSS?
- How to Create a Black and White Image Using CSS
- How to create a black image and a white image using OpenCV Python?
- Create Word Cloud using Python
- Create white text with black shadow using CSS
- How to create a scatterplot with white background and no gridlines using ggplot2 in R?
- How to plot a half-black and half-white circle using Matplotlib?
- Plot a black-and-white binary map in Matplotlib
- How to create a bar plot using ggplot2 with one bar having black border in R?
- How to create Microsoft Word paragraphs and insert Images in Python?
- Why do doctors wear White & Lawyers black?
- A bag contains 15 white and some black balls. If the probability of drawing a black ball from the bag is thrice that of drawing a white ball, find the number of black balls in the bag.
- Create a white space in HTML
- Six Sigma Certification - Black, Green, White, Yellow Belt
- How to create a sphere in R?

Advertisements