Package 'rwhatsapp'

Title: Import and Handling for 'WhatsApp' Chat Logs
Description: A straightforward, easy-to-use and robust parsing package which aims to digest history files from the popular messenger service 'WhatsApp' in all locales and from all devices.
Authors: Johannes Gruber [aut, cre]
Maintainer: Johannes Gruber <[email protected]>
License: GPL-3
Version: 0.2.4.9000
Built: 2025-03-03 03:48:31 UTC
Source: https://github.com/jbgruber/rwhatsapp

Help Index


List of emojis and corresponding descriptions.

Description

A dataset containing emojis and corresponding descriptions. This dataset was collected by combining the data from the emo package with newly scraped emojis from unicode.org.

Usage

emojis

Format

A tibble with 4085 rows and 3 columns:

  • emoji character representation of the emoji

  • name of the emoji

  • hex_runes hexadecimal representations of emoji

Details

hex_runes can be used to easily look up image files of emojis.

Source

https://github.com/hadley/emo/ and https://unicode.org/emoji/charts/


Lookup emojis from text

Description

Takes a character string or data.frame with text, looks up all emoji characters in it and also returns their description. Supports the full unicode Emoji List v13.0 (see emojis).

Usage

lookup_emoji(x, ...)

## S3 method for class 'data.frame'
lookup_emoji(x, text_field = "text", ...)

## S3 method for class 'character'
lookup_emoji(x, ...)

Arguments

x

A character vector or data.frame.

...

not currently used.

text_field

the character name or numeric index of the source 'data.frame' indicating the variable to be read in as text.


Read WhatsApp history into R

Description

Takes a history file from the “WhatsApp” messenger app (txt or zip) and returns a formatted data.frame with descriptions of the used emojis.

Usage

rwa_read(x, tz = NULL, format = NULL, verbose = FALSE, encoding = "UTF-8", ...)

Arguments

x

Path to a txt or zip file of a WhatsApp history or the history itself as character object.

tz

A time zone for date conversion. Set NULL or "" for the default time zone or a single string with a timezone identifier, see stri_timezone_list.

format

Most formats are automatically detected. If you encounter problems you can provide a custom format here. Refer to stri_datetime_parse for guidance.

verbose

A logical flag indicating whether information should be printed to the screen.

encoding

Input encoding. Should usually be "UTF-8" if files haven't changed since export from WhatsApp.

...

Further arguments passed to readLines.

Details

The history can be obtained going to the menu in a chat on the “WhatsApp” app, choosing "more", then "Export chat".

Value

A tibble with the information parsed from the history file.

Examples

history <- system.file("extdata", "sample.txt", package = "rwhatsapp")
df <- rwa_read(history)