-
Notifications
You must be signed in to change notification settings - Fork 4
/
plot_wordcloud.Rd
53 lines (43 loc) · 2.33 KB
/
plot_wordcloud.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_wordcloud.R
\name{plot_wordcloud}
\alias{plot_wordcloud}
\title{Wordclouds for 'WhatsApp' chat logs}
\usage{
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{
\item{data}{A 'WhatsApp' chat log that was parsed with \code{\link[WhatsR]{parse_chat}} and anonymize = FALSE or anonymize = "add"}
\item{names}{A vector of author names that the plots will be restricted to.}
\item{starttime}{Datetime that is used as the minimum boundary for exclusion. Is parsed with \code{\link[base]{as.POSIXct}}. Standard format is "yyyy-mm-dd hh:mm". Is interpreted as UTC to be compatible with 'WhatsApp' timestamps.}
\item{endtime}{Datetime that is used as the maximum boundary for exclusion. Is parsed with \code{\link[base]{as.POSIXct}}. Standard format is "yyyy-mm-dd hh:mm". Is interpreted as UTC to be compatible with 'WhatsApp' timestamps.}
\item{remove_stops}{Either TRUE or FALSE, default is TRUE. Configures whether stopwords from \code{\link[tm]{stopwords}} are removed from the text strings.}
\item{stop}{The language for stopword removal. Stopwords are taken from \code{\link[tm]{stopwords}}. Options are "english" and "german".}
\item{comparison}{Must be TRUE or FALSE. If TRUE, will split up wordcloud by sender. Default is FALSE.}
\item{return_data}{Will return the data frame used to create the plot if TRUE. Default is FALSE.}
\item{font_size}{Size of the words in the wordcloud, passed to \code{\link[ggplot2]{scale_size_area}}. Default is 10, a good starting value is 0.0125 * number of messages in data frame.}
\item{min_occur}{Sets the minimum frequency a token must occur in the chat for it to be included in the plot. Default is 5.}
\item{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
}
\description{
Creates a wordcloud by author for 'WhatsApp' chat logs. Requires raw message text to be present in data.
}
\examples{
data <- readRDS(system.file("ParsedWhatsAppChat.rds", package = "WhatsR"))
plot_wordcloud(data, comparison = TRUE, min_occur = 6)
}