build_messages: Reconcile and Merge Messages

Description Usage Arguments Value Author(s) Examples

View source: R/build.R

Description

build_messages() reconciles and merges the messages from im_orig_dfs$orig_message_posts and im_core_dfs$core_message_posts.

Usage

1
2
3
4
5
build_messages(
  summarize = TRUE,
  split = FALSE,
  as_tibble = ironmarch_as_tibble()
)

Arguments

summarize

logical(1L), Default: TRUE. Whether to aggregate all observations into single rows, prioritizing values found in im_core_dfs.

split

logical(1L), Default: FALSE. Whether to split the result into a named list of separate data frames, retaining all observations. Ignored if summarize is TRUE.

as_tibble

logical(1L), Default: ironmarch_as_tibble(). Whether a tibble::tibble() should be returned. Ignored if the {tibble} package is not installed.

Value

Author(s)

Brendan Knapp brendan.g.knapp@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# messages summarized to single rows ==================================================
build_messages()

# all message observations ============================================================
build_messages(summarize = FALSE)

# all message observations split into a list of data frames ===========================
split_messages <- build_messages(summarize = FALSE, split = TRUE)

# first five messages that appear in both... ==========================================
# ... `im_orig_dfs$orig_message_posts` and `im_core_dfs$core_message_posts`
split_messages[
  vapply(split_messages, function(.x) nrow(.x) == 2, logical(1L))
][1:5]

knapply/ironmarch documentation built on July 14, 2020, 12:50 a.m.