Re: [R] on lexical scoping....

2023-04-05 Thread akshay kulkarni
Dear richard, Bulls eye! thanks for your pointed reply...! THanking you, Yours sincerely, AKSHAY M KULKARNI From: Richard O'Keefe Sent: Wednesday, April 5, 2023 10:30 AM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R

Re: [R] on lexical scoping....

2023-04-05 Thread akshay kulkarni
: Re: [R] on lexical scoping The following *might* be of use to you. If you can predict what the various function invocations will do, I think you have a reasonable grasp of how lexical scoping works in R (contrary or supplementary opinions welcome). It is the sort of thing you will find

Re: [R] on lexical scoping....

2023-04-05 Thread Mark Leeds
Hi Duncan. I read it a long time ago so it's probably best if I read it again ALONG with your corrections. Every detail matters with these concepts so thanks a lot. Mark On Wed, Apr 5, 2023 at 5:12 AM Duncan Murdoch wrote: > It seems mostly correct. Here are a few quibbles: > > - I don't

Re: [R] on lexical scoping....

2023-04-05 Thread Duncan Murdoch
It seems mostly correct. Here are a few quibbles: - I don't think "owner" is a good description of the parent environment. Usually when I use owner in computing, there's an implication that the owner controls what it owns, is responsible for allocating and destroying it, etc. Parent

Re: [R] on lexical scoping....

2023-04-04 Thread Richard O'Keefe
R *does* search the environment stack. > search() [1] ".GlobalEnv""package:stats" "package:graphics" [4] "package:grDevices" "package:utils" "package:datasets" [7] "package:methods" "Autoloads" "package:base What you seem to be missing is that a package may contain

Re: [R] on lexical scoping....

2023-04-04 Thread Jeff Newmiller
Leading off with you can only have two things in an environment definitely indicates this should be read with a skeptical eye. Although the title of "Advanced R" may be more scary than someone writing notes on GitHub like a bro, IMHO Adv R is quite readable for anyone interested in questions

Re: [R] on lexical scoping....

2023-04-04 Thread Mark Leeds
obviously, everyone has different opinions on what's useful but I always found this document quite helpful. I think, in the past, someone said that there are some incorrect statements in but I'm not sure what they are.

Re: [R] on lexical scoping....

2023-04-04 Thread Bert Gunter
The following *might* be of use to you. If you can predict what the various function invocations will do, I think you have a reasonable grasp of how lexical scoping works in R (contrary or supplementary opinions welcome). It is the sort of thing you will find in the references also. If this is all

Re: [R] on lexical scoping....

2023-04-04 Thread akshay kulkarni
Dear Duncan, THanks a lot..!! THanking you, Yours sincerely, AKSHAY M KULKARNI From: Duncan Murdoch Sent: Tuesday, April 4, 2023 8:49 PM To: akshay kulkarni ; Deepayan Sarkar Cc: R help Mailing list Subject: Re: [R] on lexical scoping

Re: [R] on lexical scoping....

2023-04-04 Thread Duncan Murdoch
- *From:* Duncan Murdoch *Sent:* Tuesday, April 4, 2023 8:21 PM *To:* akshay kulkarni ; Deepayan Sarkar *Cc:* R help Mailing list *Subject:* Re: [R] on lexical scoping You can't change the basic way R searches, but you can ask for a different kind of search.  For example, to see if &qu

Re: [R] on lexical scoping....

2023-04-04 Thread akshay kulkarni
To: akshay kulkarni ; Deepayan Sarkar Cc: R help Mailing list Subject: Re: [R] on lexical scoping You can't change the basic way R searches, but you can ask for a different kind of search. For example, to see if "x" exists, you can use exists("x") and it will d

Re: [R] on lexical scoping....

2023-04-04 Thread Duncan Murdoch
g when x is not defined in the global environment but takes on a value from one of the loaded packages? any packages for that? THanking you, Yours sincerely, AKSHAY M KULKARNI From: Deepayan Sarkar Sent: Tuesday, April 4, 2023 7:51 PM To: akshay kulkarni

Re: [R] on lexical scoping....

2023-04-04 Thread Duncan Murdoch
.1.10 in that manual for how R looks up variables. Duncan Murdoch THanking you, Yours sincerely, AKSHAY M KULKARNI *From:* Duncan Murdoch *Sent:* Tuesday, April 4, 2023 7:48 PM *To:* akshay kulkarni ; R help Mailing list

Re: [R] on lexical scoping....

2023-04-04 Thread akshay kulkarni
Dear Ducan, Very informative! THanks a lot! THanking you, Yours sincerely, AKSHAY M KULKARNI From: Duncan Murdoch Sent: Tuesday, April 4, 2023 8:14 PM To: akshay kulkarni ; R help Mailing list Subject: Re: [R] on lexical scoping

Re: [R] on lexical scoping....

2023-04-04 Thread akshay kulkarni
Dear Jeff, THanks a lot for the pithy reply... Thanking you, Yours sincerely, AKSHAY M KULKARNI From: Jeff Newmiller Sent: Tuesday, April 4, 2023 7:43 PM To: r-help@r-project.org ; akshay kulkarni ; R help Mailing list Subject: Re: [R

Re: [R] on lexical scoping....

2023-04-04 Thread akshay kulkarni
Dear Bert, THanks a lot. I will take a look at those... THanking you, Yours sincerely, AKSHAY M KULKARNI From: Bert Gunter Sent: Tuesday, April 4, 2023 7:48 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] on lexical scoping

Re: [R] on lexical scoping....

2023-04-04 Thread akshay kulkarni
lkarni ; R help Mailing list Subject: Re: [R] on lexical scoping On 04/04/2023 9:56 a.m., akshay kulkarni wrote: > Dear Members, > I have the following code typed at the console > prompt: > > y <- x*10 > > X has not been defined a

Re: [R] on lexical scoping....

2023-04-04 Thread akshay kulkarni
KULKARNI From: Deepayan Sarkar Sent: Tuesday, April 4, 2023 7:51 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] on lexical scoping On Tue, Apr 4, 2023 at 7:26 PM akshay kulkarni mailto:akshay...@hotmail.com>> wrote: Dear M

Re: [R] on lexical scoping....

2023-04-04 Thread Deepayan Sarkar
On Tue, Apr 4, 2023 at 7:26 PM akshay kulkarni 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

Re: [R] on lexical scoping....

2023-04-04 Thread Duncan Murdoch
On 04/04/2023 9:56 a.m., akshay kulkarni 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

Re: [R] on lexical scoping....

2023-04-04 Thread Bert Gunter
?search and ?environment See also "The R Language Definition" manual for similar such questions. -- Bert On Tue, Apr 4, 2023 at 6:56 AM akshay kulkarni wrote: > > Dear Members, > I have the following code typed at the console > prompt: > > y <- x*10 > > X has

Re: [R] on lexical scoping....

2023-04-04 Thread Jeff Newmiller
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