create_chatlog {WhatsR}R Documentation

Creating test data in the structure of 'WhatsApp' chat logs

Description

Creates a .txt file in the working directory that has the same structure as chat logs exported from 'WhatsApp'. Messages have a timestamp, sender name and message body containing lorem ipsum, emoji, links, smilies, location, omitted media files, linebreaks, self-deleting photos, and 'WhatsApp' system messages. Timestamps are formatted according to specified phone operating system and time format settings. 'WhatsApp' system messages are formatted according to specified phone operating system and language.

Usage

create_chatlog(
  n_messages = 150,
  n_chatters = 2,
  n_emoji = 50,
  n_diff_emoji = 20,
  n_links = 20,
  n_locations = 5,
  n_smilies = 20,
  n_diff_smilies = 15,
  n_media = 10,
  media_excluded = TRUE,
  n_sdp = 3,
  n_deleted = 5,
  startdate = "01.01.2019",
  enddate = "31.12.2022",
  language = "german",
  time_format = "24h",
  os = "android",
  path = getwd(),
  chatname = "Simulated_WhatsR_chatlog"
)

Arguments

n_messages

Number of messages that are contained in the created .txt file.

n_chatters

Number of different chatters present in the created .txt file.

n_emoji

Number of messages that contain emoji. Must be smaller or equal to n_messages.

n_diff_emoji

Number of different emoji that are used in the simulated chat.

n_links

Number of messages that contain links. Must be smaller or equal to n_messages.

n_locations

Number of messages that contain locations. Must be smaller or equal to n_messages.

n_smilies

Number of messages that contain smilies. Must be smaller or equal to n_messages.

n_diff_smilies

Number of different smilies that are used in the simulated chat.

n_media

Number of messages that contain media files. Must be smaller or equal to n_messages.

media_excluded

Whether media files were excluded in simulated export or not. Default is TRUE.

n_sdp

Number of messages that contain self-deleting photos. Must be smaller or equal to n_messages.

n_deleted

Number of messages that contain deleted messages. Must be smaller or equal to n_messages.

startdate

Earliest possible date for messages. Format is 'dd.mm.yyyy'. Timestamps for messages are created automatically between startdate and enddate. Input is interpreted as UTC

enddate

Latest possible date for messages. Format is 'dd.mm.yyyy'. Timestamps for messages are created automatically between startdate and enddate. Input is interpreted as UTC

language

Parameter for the language setting of the exporting phone. Influences structure of system messages

time_format

Parameter for the time format setting of the exporting phone (am/pm vs. 24h). Influences the structure of timestamps.

os

Parameter for the operating system setting of the exporting phone. Influences the structure of timestamps and 'WhatsApp' system messages.

path

Character string for indicating the file path of where to save the file. Can be NA to not save a file. Default is getwd()

chatname

Name for the created .txt file.

Value

A .txt file with a simulated 'WhatsApp' chat containing lorem ipsum but all structural properties of actual chats.

Examples

SimulatedChat <- create_chatlog(path = NA)

[Package WhatsR version 1.0.4 Index]