Description Usage Arguments Details Author(s) See Also
Automatically generate an R funtion using source code contained in an R script.
1 | autofun(fun.name, read.file, write.file)
|
fun.name |
Name of the function. |
read.file |
A connection, or a character string naming the file that contains the R source code that will constitute the body of the function. |
write.file |
A connection, or a character string naming the file to write the function to. |
The idea behind autofun
is to use a standalone R script to create an
R function. This is done parsing the R script and using the returned
expression as the function body.
A function foo
returned by autofun
gets all the arguments from
the working environment. This is done by evaluating the function with
eval(foo())
. Such a function can return several objects.
Alessandro Samuel-Rosa alessandrosamuelrosa@gmail.com
base{parse}
, utils{capture.output}
,
base{eval}
, base{expression}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.