getVarsFromFormula: Parse a formula to get the variable list

Description Usage Arguments Details Value Author(s) Examples

Description

Get x, y, weight, series from a formula expression. If expr cannot be interpreted as formula, it will be returned as a character vector as-is.

Usage

1
2
3

Arguments

expr

An expression to coerce to formula.

...

Other arguments to pass to the function.

Details

There are two forms of arguments:

Value

If more than one asterisks or pipes are detected, the function will only extract the last match as series or weight.

Author(s)

Yiying Wang, wangy@aetna.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
## Identify ingredients in a formula.
getVarsFromFormula("y+z~x*w+m|d")  ## return
  \tabular(cccc){
   x \tab y \tab series \tab weight \cr
   "x + m" \tab "y + z" \tab "d"  \tab  "w"
  }
  
## it is equivalent to
parse_formula(y+z~x*w+m|d)

## another form
parse_formula(y+z, x+m, d, w)


## End(Not run)

madlogos/aseskit documentation built on June 26, 2019, 12:17 a.m.