Dear R-help,
I wrote the following lines in order to use a variable from a parent
frame in my callM() function. I would like to solve this by only editing
the callM(function). When I run this code I obtain a empty list, meaning
that eval(ls(),sys.frame(-1)) could not access the variables in the
parent function. Any suggestions? Thanks in advance!
metaCall <- function()
{
NN <- 99
callM()
}
callM <- function()
{
Ls <- eval(ls(),sys.frame(-1))
print(Ls)
### use Ls to call a certain model named M
}
metaCall()
--
Zé Miguel
_______________________________
JM Delgado
Reichenberger Str. 52
10999 Berlim
Alemanha
t(d):+49 30 841 18 127
m(d):+49 176 9633 92 56
m(p):+351 91 671 07 08
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.