是否有更多方法可以通过名称调用函数,如下所示通过do.call?
setClass(Class = "MyClass",
representation = representation(name = "character",
type = "character"
)
)
MyClass <- function(...) new("MyClass",...)
cC<-"MyClass"
do.call(cC,list())
答案 0 :(得分:1)
另一种方式:
cstor <- get(cC)
cstor()