get_all_data_types: Get all data types

View source: R/data_helpers.R

get_all_data_typesR Documentation

Get all data types

Description

Creates dataframe with all data types (including NA types) that are possible from a model.

Usage

get_all_data_types(
  model,
  complete_data = FALSE,
  possible_data = FALSE,
  given = NULL
)

Arguments

model

A causal_model. A model object generated by make_model.

complete_data

Logical. If 'TRUE' returns only complete data types (no NAs). Defaults to 'FALSE'.

possible_data

Logical. If 'TRUE' returns only complete data types (no NAs) that are *possible* given model restrictions. Note that in principle an intervention could make observationally impossible data types arise. Defaults to 'FALSE'.

given

A character. A quoted statement that evaluates to logical. Data conditional on specific values.

Value

A data.frame with all data types (including NA types) that are possible from a model.

Examples


make_model('X -> Y') |> get_all_data_types()
model <- make_model('X -> Y') %>%
  set_restrictions(labels = list(Y = '00'), keep = TRUE)
  get_all_data_types(model)
  get_all_data_types(model, complete_data = TRUE)
  get_all_data_types(model, possible_data = TRUE)
  get_all_data_types(model, given  = 'X==1')
  get_all_data_types(model, given  = 'X==1 & Y==1')


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