Generating a wordcloud of any text - Text Mining in R


Load the below library, if already installed.
If required to install then use the below code:
install.packages("wordcloud")
install.packages("RColorBrewer")

# Generate the WordCloud
library("wordcloud")
library("RColorBrewer")
par(bg="grey30")
png(file="WordCloud.png",width=1000,height=700, bg="grey30") # file shall save in your default directory
wordcloud(d$word, d$freq, col=terrain.colors(length(d$word), alpha=0.9), random.order=FALSE, rot.per=0.3 )
title(main = "Your effort", font.main = 1, col.main = "cornsilk3", cex.main = 1.5)
dev.off()

No comments:

Post a Comment

7 Stages of Machine Learning - Framework Introduction

Framework Introduction 7 Stages Introduction Stage 1: Problem Definition Stage 2: Data Collection Stage 3: Data Preparation Stage 4: Data Vi...