as.function.formula {dat}R Documentation

Coerce a formula into a function

Description

Convert a formula into a function. See map and extract for examples.

Usage

## S3 method for class 'formula'
as.function(x, ...)

Arguments

x

(formula) see examples

...

not used

Value

An object inheriting from class function.

Examples

as.function(~ .)(1)
as.function(x ~ x)(1)
as.function(f(x, y) ~ c(x, y))(1, 2)
as.function(numeric : x ~ x)(1) # check for class
as.function(numeric(1) : x ~ x)(1) # check for class + length

[Package dat version 0.5.0 Index]