can Murdoch [mailto:murd...@stats.uwo.ca]
Sent: Thursday, January 29, 2009 9:54 AM
To: David Reiner
Cc: Henrik Bengtsson; r-help@r-project.org; SnowManPaddington
Subject: [SPAM] - Re: [R] scoping rules for 'for' [was - Re: for/if loop
] - Found word(s) list error in the Text body
Fe
On Thu, Jan 29, 2009 at 12:05 PM, Henrik Bengtsson
wrote:
> PS. About the double-letter index (e.g. ii vs. i); A few years ago
> someone suggested me to use this, because it is much easier to search
> for 'ii' in an editor compared with a single-letter 'i'. So true. I
> made the move immediatel
gt; Thanks to all for the clarifications.
> -- David
>
>
> -Original Message-
> From: Duncan Murdoch [mailto:murd...@stats.uwo.ca]
> Sent: Thursday, January 29, 2009 9:54 AM
> To: David Reiner
> Cc: Henrik Bengtsson; r-help@r-project.org; SnowManPaddington
> Su
, January 29, 2009 9:54 AM
To: David Reiner
Cc: Henrik Bengtsson; r-help@r-project.org; SnowManPaddington
Subject: [SPAM] - Re: [R] scoping rules for 'for' [was - Re: for/if loop
] - Found word(s) list error in the Text body
Feel free to do what you like to the variable within the
lo
Duncan Murdoch wrote:
> On 1/29/2009 10:39 AM, dav...@rhotrading.com wrote:
>
>> And if the loop variable does not exist before the 'for', why is it
>> created in the parent(?) environment at all?
>
> It's created in the current evaluation frame, because that's where
> everything gets created un
Thanks for straighten this out. Sorry for my misleading suggestion
that "special" scoping rules comes into play; it is just about
reassignments at the beginning of each loop. Here is a slightly
better illustration:
ii <- "start";
cat("ii:",ii,"\n");
for (ii in 1:2) {
cat("Outer ii:",ii,"\n");
On 1/29/2009 11:06 AM, Patrick Burns wrote:
Certainly not a complete description, but
'The R Inferno' talks about this on page 62.
Hmmm, I don't think I agree with that description. There's only one
object named i in that example (which was
for (i in 1:6) {
cat('\n i is', i, '\n\n')
for
Certainly not a complete description, but
'The R Inferno' talks about this on page 62.
Patrick Burns
patr...@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of "The R Inferno" and "A Guide for the Unwilling S User")
dav...@rhotrading.com wrote:
I apologize for posting a wron
On 1/29/2009 10:39 AM, dav...@rhotrading.com wrote:
I apologize for posting a wrong opinion; I should of course have checked
before posting.
Henrik's examples illustrate something I had never realized before, and
it really surprised me!
Where can I read the technical details of this scoping aspe
I apologize for posting a wrong opinion; I should of course have checked
before posting.
Henrik's examples illustrate something I had never realized before, and
it really surprised me!
Where can I read the technical details of this scoping aspect of 'for'
as it still presents
some subtle puzzles f
10 matches
Mail list logo