Re: [R] incrementing for loop by 2

From: Dimitris Rizopoulos <Dimitris.Rizopoulos_at_med.kuleuven.be>
Date: Thu, 24 Jul 2008 16:25:45 +0200

you can define the 'seq' argument of for() accordingly, e.g.,

for(i in seq(0, 20, 2)) print(i)

I hope it helps.

Best,
Dimitris



Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
      http://perswww.kuleuven.be/dimitris_rizopoulos/


Quoting "Clark, Jennifer H" <jclar2_at_Central.UH.EDU>:

> Dear List-serv members:
> How can I structure a for loop so that it will increment the counter
> by two using R? I am just looking for a simple example that shows
> where the incrementing part should go. Thanks!
>
> Jennifer
>
> --
> Jennifer Hayes Clark
> Assistant Professor
> Department of Political Science
> University of Houston
> Houston, TX 77204-3011
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_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.
>
>

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



R-help_at_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. Received on Thu 24 Jul 2008 - 14:54:06 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 Jul 2008 - 15:02:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive