Don't worry, I got it:

for(x in seq(1,100,5)) {
     print(x)
}

where the step size is 5.

rcoder


rcoder wrote:
> 
> Hi everyone,
> 
> Is there a way to vary the increment size in a for loop? For e.g. when
> incrementing in steps greater than unity.
> 
> Thanks,
> 
> rcoder
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/increment-size-in-for-loop-tp18893893p18894006.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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