formula_tools: Tools for manipulating formulas

formula_toolsR Documentation

Tools for manipulating formulas

Description

Tools for manipulating formulas

Usage

lhs(formulas, surv = FALSE)

lhs(formulas) <- value

rhs_vars(formulas)

tidy_formulas(formulas, kwd, prefix = "V")

Arguments

formulas

list of formulae

surv

logical indicating whether to treat as survey data

value

character vector to assign

kwd

string used to denote copula

prefix

string to begin each new variable name

Details

lhs returns a character vector containing left-hand sides of a list of formulae. If surv=TRUE then two responses are returned in the event of the left-hand side being a valid Surv object. ⁠lhs<-⁠ allows one to assign the left-hand sides of variables in the obvious way.

tidy_formulas ensures that all formulae in a list have a left hand side, by giving them names of the form Vn where n is some positive integer. The prefix V can be changed using the argument prefix.

rhs_vars extracts all the variables used on the right-hand sides of a list of formulas.

Functions

  • lhs(): Obtain left-hand sides from list of formulas

  • lhs(formulas) <- value: Assign left-hand sides to list of formulas

  • rhs_vars(): Extract variables from right-hand sides

  • tidy_formulas(): Tidy up formulae


rje42/causl documentation built on June 1, 2025, 2:50 p.m.