Skip to content

starship9/whatsappR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 

Repository files navigation

Generating a wordcloud based on the data generated from your Whatsapp chats.

Prerequisites:

  • R (preferably version 3.2.3 or higher)
  • A WhatsApp chat in plain text format

Here's how to get the text data:

whatsappRaw <- read.table("WhatsApp Chat with CSE Junior Year.txt", header=FALSE,fill = TRUE)
library(dplyr)
whatsappDF <- tbl_df(whatsappRaw)
head(whatsappDF) 

Selecting only the names of the recipients (the data frame is loaded in the form of columns from V1:V20):

select(whatsappDF,V5)

The wordcloud of the words present in the chat was generated in the following way:

library(wordcloud)
wordcloud(whatsappDF$V5, random.order = FALSE, max.words = 100, col = brewer.pal(7,"Accent"))

Wordcloud

The sentiment comparison cloud of the words present in the chat was generated in the following way:

tidyWA %>% inner_join(get_sentiments("bing")) %>% count(word, sentiment, sort = TRUE) %>% acast(word ~
                                                                                                    sentiment, value.var = "n", fill = 0) %>% comparison.cloud(
                                                                                                      colors = c("#F8766D", "#00BFC4"),
                                                                                                      max.words = 100,
                                                                                                      scale = c(3, 0.5)
                                                                                                    )
)

Sentiment Cloud

TODO:

  • Create a shiny web app

About

Visualising whatsapp chats using the "Email chat" option available.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published