有没有办法将对象名称传递给 do.call() 函数?
例如:
#First make a function that will return the name of object itself.
PrintObjectName <- function(obj){
print(deparse(substitute(obj)))
}
data(iris)
PrintObjectName(iris)
[1] "iris" #This is what I want
do.call(what="PrintObjectName", args=list(obj=iris))
#The output is a messy stuff