Skip to content

A question on substitute()

2 messages · Bert Gunter

#
I would appreciate any help in correcting my misunderstanding of the
following:
quote(x + 5)  ## as expected
quote(x + 5)  ## as expected
[1] 5
quote(x + a)  ## unexpected

I conclude from this that there is something special about .GlobalEnv that
does not allow it to behave as documented for the env argument in
?substitute, to wit:

"env:

an environment or a list object. Defaults to the current evaluation
environment."

I would be grateful for any insight, as I am clearly missing something.


Note: (though I don't think this matters):
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16


Cheers to all,

Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
#
Please disregard my previous post. My understanding is correct, and the
behavior is **AS DOCUMENTED**.
I failed to read the docs carefully. Mea Culpa.

Best,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Sun, Dec 13, 2020 at 8:32 PM Bert Gunter <bgunter.4567 at gmail.com> wrote: