expand_data: Expand compact data object to data frame

View source: R/data_helpers.R

expand_dataR Documentation

Expand compact data object to data frame

Description

Expand compact data object to data frame

Usage

expand_data(data_events = NULL, model)

Arguments

data_events

A data.frame. It must be compatible with nodes in model. The default columns are event, strategy and count.

model

A causal_model. A model object generated by make_model.

Value

A data.frame with rows as data observation

Examples


model <- make_model('X->M->Y')
make_events(model, n = 5) %>%
  expand_data(model)
make_events(model, n = 0) %>%
  expand_data(model)
 


CausalQueries documentation built on June 22, 2024, 6:50 p.m.