f_expand: Formula interpolation

Description Usage Arguments Details Value See Also Examples

View source: R/f_expand.R

Description

Formula interpolation to expand functions in a formula into lists of variables. The interpolation provided here are convenience functions for formulae used in modeling applications.

Usage

1
f_expand(f, lhs = TRUE, rhs = TRUE, envir = parent.frame())

Arguments

f

A formula

lhs

logical. Expand the left-hand side of the formula

rhs

logical. Expand the left-hand side of the formula

envir

An environment in which to evaluate the functions. This is where the expansion functions look for variable names.

Details

The following special interpolation functions are provided:

Value

A formula object

See Also

See bquote and f_interp for other formula interpolation methods.

Examples

1
2
3
4
5
6
f_expand(~ .m("Sepal\\.*"), envir = iris)
f_expand(~ .x(everything()), envir = iris)
f_expand(~ .x(-Sepal.Width), envir = iris)
f_expand(~ .x(matches("Length"), -Sepal.Length), envir = iris)
f_expand(~ .p(is.numeric), envir = iris)
f_expand(~ .p(is.numeric, sep = "*"), envir = iris)

jrnold/rubbish documentation built on May 20, 2019, 2:05 a.m.