I want to build
f <- function(...) {
g <- function(x) x ^ 2
list(...)
}
so that I can use f(g(4))with list(...)and list(...)in list(16).
In general, I will define several temporary functions inside fthat the user can call when called f(...).
I experimented with assignand newenvironment, but only got a little confused. Help with an elegant solution appreciated.
The reason for this is because I want the function in the package Hmisc drawPlotto allow users to specify common function names as input to create a series of graphic elements, and I don’t know if you want to reserve these names of a common type. For example:.
d <- drawPlot(Curve(), Points())
source
share