Creates a wordcloud by author for 'WhatsApp' chat logs. Requires raw message text to be present in data.

plot_wordcloud(
  data,
  names = "all",
  starttime = "1960-01-01 00:00",
  endtime = "2200-01-01 00:00",
  remove_stops = TRUE,
  stop = "english",
  comparison = FALSE,
  return_data = FALSE,
  font_size = 10,
  min_occur = 5,
  exclude_sm = FALSE
)

Arguments

data

A 'WhatsApp' chat log that was parsed with parse_chat and anonymize = FALSE or anonymize = "add"

names

A vector of author names that the plots will be restricted to.

starttime

Datetime that is used as the minimum boundary for exclusion. Is parsed with as.POSIXct. Standard format is "yyyy-mm-dd hh:mm". Is interpreted as UTC to be compatible with 'WhatsApp' timestamps.

endtime

Datetime that is used as the maximum boundary for exclusion. Is parsed with as.POSIXct. Standard format is "yyyy-mm-dd hh:mm". Is interpreted as UTC to be compatible with 'WhatsApp' timestamps.

remove_stops

Either TRUE or FALSE, default is TRUE. Configures whether stopwords from stopwords are removed from the text strings.

stop

The language for stopword removal. Stopwords are taken from stopwords. Options are "english" and "german".

comparison

Must be TRUE or FALSE. If TRUE, will split up wordcloud by sender. Default is FALSE.

return_data

Will return the data frame used to create the plot if TRUE. Default is FALSE.

font_size

Size of the words in the wordcloud, passed to scale_size_area. Default is 10, a good starting value is 0.0125 * number of messages in data frame.

min_occur

Sets the minimum frequency a token must occur in the chat for it to be included in the plot. Default is 5.

exclude_sm

If TRUE, excludes the 'WhatsApp' system messages from word clouds. Default is FALSE.

Value

A wordcloud plot per author for 'WhatsApp' chat logs

Examples

data <- readRDS(system.file("ParsedWhatsAppChat.rds", package = "WhatsR"))
plot_wordcloud(data, comparison = TRUE, min_occur = 6)