0

是否有更多方法可以像我在下面通过 do.call 那样按名称调用函数?

setClass(Class = "MyClass",
         representation = representation(name = "character",
                                         type = "character"
         )
)
MyClass <- function(...) new("MyClass",...)
cC<-"MyClass"
do.call(cC,list())
4

1 回答 1

1

另一种方式:

cstor <- get(cC)
cstor()
于 2013-09-04T11:11:00.503 回答