plot_emoji {WhatsR}R Documentation

Plotting emoji distributions in 'WhatsApp' chat logs

Description

Plots four different types of graphs for the emoji contained in a parsed 'WhatsApp' chat log. Returns dataframe used for plotting if desired.

Usage

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
)

Arguments

data

A 'WhatsApp' chat log that was parsed with parse_chat.

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 anytime. 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 anytime. Standard format is "yyyy-mm-dd hh:mm". Is interpreted as UTC to be compatible with 'WhatsApp' timestamps.

min_occur

Minimum number of occurrences for emoji to be included in the plots. Default is 1.

return_data

If TRUE, returns the subsetted data frame used for plotting. Default is FALSE.

emoji_vec

A vector of emoji that the visualizations and data will be restricted to.

plot

The type of plot that should be returned. Options are "heatmap", "cumsum", "bar" and "splitbar".

emoji_size

Determines the size of the emoji displayed on top of the bars for "bar" and "splitbar", default is 10.

font_family

Character string for indicating font family used to plot_emoji. Fonts might need to be installed manually, see font_import.

exclude_sm

If TRUE, excludes the 'WhatsApp' system messages from the descriptive statistics. Default is FALSE.

Value

Plots and/or the subset data frame based on author names, datetime and emoji occurrence

Examples

# 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()

[Package WhatsR version 1.0.4 Index]