brew_dyads: brew_dyads

Description Usage Arguments Value Examples

Description

Construct dyadic data using the '_root's of source and target variables. All dyads with missing data for either sideA or sideB are dropped. The data allows one to quickly aggregated cameo activity between two partners. All dyadic associations are generated for a comprehensive time range.

Usage

1
brew_dyads(.data, .aggregate_date = "year")

Arguments

.data

passed from 'tap_events()' or 'connect_phx_db("events")'

.aggregate_date

a character string specifying a time unit or a multiple of a unit to be rounded to. Valid base units are day, week, month, bimonth, quarter, season, halfyear and year. Default is "year"

Value

tbl_df with dyadic pairs aggregated by date. In addition, dummy variables are generated for all cameo codes requested to capture if that cameo coding structure was utilized in that dyad time point.

Examples

1
2
3
tap_events(cameo_code = c("041"),"SWB") %>% 
sample_n(20) %>% 
brew_dyads(.aggregate_date = "year")

edunford/phx documentation built on June 6, 2019, 12:22 p.m.