[R] on lexical scoping....

akshay kulkarni @k@h@y_e4 @end|ng |rom hotm@||@com
Tue Apr 4 16:37:13 CEST 2023


Dear Jeff,
                  THanks a lot for the pithy reply...

Thanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Jeff Newmiller <jdnewmil using dcn.davis.ca.us>
Sent: Tuesday, April 4, 2023 7:43 PM
To: r-help using r-project.org <r-help using r-project.org>; akshay kulkarni <akshay_e4 using hotmail.com>; R help Mailing list <r-help using r-project.org>
Subject: Re: [R] on lexical scoping....

Namespaces. Packages only export specific object names from their namespaces. But few instances of x would be found there.

Also, function argument lists are not added to the search path until the functions are running, and then the search path only goes through the environments in which the running functions were defined, not through the call stack.

Read Advanced R. [1]

[1] https://adv-r.hadley.nz/environments.html

On April 4, 2023 6:56:04 AM PDT, akshay kulkarni <akshay_e4 using hotmail.com> wrote:
>Dear Members,
>                             I have the following code typed at the console prompt:
>
>y   <-   x*10
>
>X has not been defined and the above code throws an object not found error. That is, the global environment does not contain x. Why doesn't it look further in the environment stack, like that of packages? There are thousands of packages that contain the variable named  x. Of course, that happens if the above code is in a function (or does it?).
>
>What concept of R is at work in this dichotomy?
>
>THanking you,
>Yours sincerely,
>AKSHAY M KULKARNI
>
>       [[alternative HTML version deleted]]
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

--
Sent from my phone. Please excuse my brevity.

	[[alternative HTML version deleted]]



More information about the R-help mailing list