plot_emoji.Rd
Plots four different types of graphs for the emoji contained in a parsed 'WhatsApp' chat log. Returns dataframe used for plotting if desired.
plot_emoji(
data,
names = "all",
starttime = "1960-01-01 00:00",
endtime = "2200-01-01 00:00",
min_occur = 1,
return_data = FALSE,
emoji_vec = "all",
plot = "bar",
emoji_size = 10,
font_family = "Noto Color Emoji",
exclude_sm = FALSE
)
A 'WhatsApp' chat log that was parsed with parse_chat
.
A vector of author names that the plots will be restricted to.
Datetime that is used as the minimum boundary for exclusion. Is parsed with anytime
. Standard format is "yyyy-mm-dd hh:mm". Is interpreted as UTC to be compatible with 'WhatsApp' timestamps.
Datetime that is used as the maximum boundary for exclusion. Is parsed with anytime
. Standard format is "yyyy-mm-dd hh:mm". Is interpreted as UTC to be compatible with 'WhatsApp' timestamps.
Minimum number of occurrences for emoji to be included in the plots. Default is 1.
If TRUE, returns the subsetted data frame used for plotting. Default is FALSE.
A vector of emoji that the visualizations and data will be restricted to.
The type of plot that should be returned. Options are "heatmap", "cumsum", "bar" and "splitbar".
Determines the size of the emoji displayed on top of the bars for "bar" and "splitbar", default is 10.
Character string for indicating font family used to plot_emoji. Fonts might need to be installed manually, see font_import
.
If TRUE, excludes the 'WhatsApp' system messages from the descriptive statistics. Default is FALSE.
Plots and/or the subset data frame based on author names, datetime and emoji occurrence
# importing data
data <- readRDS(system.file("ParsedWhatsAppChat.rds", package = "WhatsR"))
# opening AGG graphics device from the ragg package (replace tempfile with filepath)
ragg::agg_png(tempfile(), width = 800, height = 600, res = 150)
# plotting emoji
plot_emoji(data,font_family="Times", exclude_sm = TRUE) #font_family = "Noto Color Emoji" on Linux
# Close the AGG device
dev.off()
#> agg_png
#> 2