我想找到环境并将它们作为变量。我的目标是能够进行一些后续调用,sys.source
即使我忘记了作为变量的环境,但我知道它的名称。例子:
MyFuns <- attach(NULL, name = 'Myfuns')
sys.source('myFunctions.R', envir = Myfuns)
rm('MyFuns')
any(grepl('MyFuns', search())) # It is there
sys.source('oneMoreFunction.R', envir = Myfuns) # Will not work because the variable as been suppressed.
谢谢!