View source: R/formula_tools.R
expand_formula | R Documentation |
Create formulas by expanding out string vector arguments
expand_formula(formula, ...)
formula |
An R formula containing terms referencing objects defined in the parent environment or in ... Terms must each consist of a single lowercase or uppercase letter. |
... |
Variables referenced in |
chr.
expand_formula(~a:b + d, a=c('a1','a2'), b=c('b1','b2'), d='d1') #we could have equivalently defined any of the variables in the formula in the calling environment: a=c('a1','a2') b=c('b1','b2') d='d1' expand_formula(~a:b + d) #variables can be specified in glue-style expand_formula(~a:b, a=c('a{h}', 'a{h+1}'), b='a{h}', h=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.