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, Thomas Chesney <
thomas.ches...@nottingham.ac.uk> 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)
>
> 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?
>
> Thank you,
>
> ThomasThis message and any attachment are intended solely for the
> addressee and may contain confidential information. If you have received
> this message in error, please send it back to me, and immediately delete
> it.   Please do not use, copy or disclose the information contained in this
> message or in any attachment.  Any views or opinions expressed by the
> author of this email do not necessarily reflect the views of the University
> of Nottingham.
>
> This message has been checked for viruses but the contents of an attachment
> may still contain software viruses which could damage your computer system:
> you are advised to perform your own checks. Email communications with the
> University of Nottingham may be monitored as permitted by UK legislation.
> ______________________________________________
> R-help@r-project.org mailing list
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to