m...@yahoo.de]
Sent: Monday, December 12, 2011 11:59 AM
To: Thomas Chesney
Cc: r-help@r-project.org
Subject: Re: [R] For loop indicies
You may want to check how your loop "misses out" the zero:
C <- 5
for (i in 0:C) print(i)
## gives me
[1] 0
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
Regards
You may want to check how your loop "misses out" the zero:
C <- 5
for (i in 0:C) print(i)
## gives me
[1] 0
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
Regards,
Enrico
Am 12.12.2011 12:44, schrieb Thomas Chesney:
I would like to run a for loop with an index going from 0 to 499 but the
following seems t
Hi,
On Mon, Dec 12, 2011 at 6:44 AM, Thomas Chesney
wrote:
> I would like to run a for loop with an index going from 0 to 499 but the
> following seems to miss out the first value:
>
> C <- 499
> for (i in 0:C)
First off, you've named your variable for an existing function, which
can cause all
Hi, what about this:
C <- 0:499
for (i in C)
{
cat (i," ")
}
Best regards,
Andris Jankevics
AIO
Groningen Bioinformatics Centre
Groningen Biomolecular Sciences and Biotechnology Institute
University of Groningen
Kerklaan 30, Haren, 9751 NN, The Netherlands
On Mon, Dec 12, 2011 at 11:44, Thom
I would like to run a for loop with an index going from 0 to 499 but the
following seems to miss out the first value:
C <- 499
for (i in 0:C)
The alternative is:
C <- 500
for (i in 1:C)
{
#Then every time I use i, I replace it with i-1
}
Is this a good way to do it or is tere a better way?
Th
5 matches
Mail list logo