formula_from_vars: Generate model formula by specifying which variables have...

View source: R/formula_utils.R

formula_from_varsR Documentation

Generate model formula by specifying which variables have totals or not.

Description

Generate model formula by specifying which variables have totals or not.

Usage

formula_from_vars(
  nontotal_vars = NULL,
  total_vars = NULL,
  simplify = TRUE,
  env = parent.frame()
)

Arguments

nontotal_vars

character vector of the variable names without totals

total_vars

character vector of the variable names with totals

simplify

logical value, default TRUE. Determines whether the formula should be simplified before output or not.

env

the environment for the output formula

Value

model formula

Author(s)

Daniel Lupp

Examples

formula_from_vars(c("a", "b", "c"), c("a"))
formula_from_vars(c("a", "b", "c"), c("a", "c"))
formula_from_vars(c("a", "b", "c"), c("a", "b", "c"))
formula_from_vars(c("a", "b", "c"), NULL)
formula_from_vars(NULL, c("a", "b", "c"))
formula_from_vars(c("a", "b"), c("d"))

SSBtools documentation built on Oct. 30, 2024, 5:09 p.m.