【发布时间】:2021-01-08 20:24:49
【问题描述】:
foo <- function() {
# how to know what environment_of_caller is
}
caller <- function() {
# environment_of_caller
foo()
}
我正在编写的函数需要知道其调用者的环境。可以在不将环境作为参数传递的情况下完成吗?
【问题讨论】:
-
你可以使用
parent.frame
标签: r r-environment