Thank you Peter,
for the comprehensive explanation. The reason I asked Does 'search do it?' is
that as I can run
ls(env=environment(h))
I can run
ls(env=environment(package:methods))
or ls(package:methods)
which I can see by search.
I thought maybe what I see by search is all the environments
Try 'get(x, env = environment(h))'
-roger
Ron Ophir wrote:
Hi,
I'm trying to understand environment object in R.
I used the example:
f - function(x) {
y - 10
g - function(x) x + y
return(g)
}
h - f()
h(3)
then i saw that f return an
Ron Ophir [EMAIL PROTECTED] writes:
Hi,
I'm trying to understand environment object in R.
I used the example:
f - function(x) {
y - 10
g - function(x) x + y
return(g)
}
h - f()
h(3)
then i saw that f return an environment
h
function(x) x +
Hej,
but in your function you add x and y to 10 and 3, so your values are
merged to one value available in g variable.
And now you want to see what was your y and your x?
I guess I do not get the idea of your question.
Well, then you could return y and x as well as g.
Greetz n god luck.
Roger