Skip to contents

DRAFT utility to use formulas provided as text, to calculate indicators

Usage

calc_byformula(
  mydf,
  formulas = NULL,
  keep = formula_varname(formulas),
  quiet = FALSE
)

Arguments

mydf

data.frame of indicators or variables to use

formulas

text strings of formulas - WARNING: this should not really be used on user-provided, untrused formula strings, since the contents could potentially be a security risk

keep

useful if some of the formulas are just interim steps creating evanescent variables created only for use in later formulas and not needed after that

quiet

if FALSE, prints to console the success/failure of each formula

Value

data.frame of results, but if mydf was a data.table, returns a data.table

Details