Description Usage Arguments Value Author(s) Examples
as.fun
is a generic function that does the same as as.function
from package base, with the additional feature that
as.fun.character
converts a string into the function it names.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | as.fun(x, ...)
## Default S3 method:
as.fun(x, envir = parent.frame(), ...)
## S3 method for class 'character'
as.fun(x, ...)
## S3 method for class 'name'
as.fun(x, ...)
## S3 method for class 'call'
as.fun(x, ...)
## S3 method for class 'numeric'
as.fun(x, ...)
## S3 method for class 'logical'
as.fun(x, ...)
## S3 method for class 'factor'
as.fun(x, ...)
## S3 method for class 'complex'
as.fun(x, ...)
## S3 method for class 'data.frame'
as.fun(x, ...)
## S3 method for class 'lm'
as.fun(x, ...)
## S3 method for class 'rpart'
as.fun(x, ...)
|
x |
The object to convert. |
... |
Additional arguments (currently not used). |
envir |
Environment in which the function should be defined. |
The desired function.
as.fun.character
is adapted from MrFlick,
see https://stackoverflow.com/a/38984214 on StackOverflow.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.