Hi, 

  I define a function named starStop with three inputs: start, stop and
increment.

> startStop <- function(start, stop, increment) {
+ for (i in seq(start, stop, increment+1)) cat(i,"-",i+increment,"\n")}
> startStop(12, 35, 5)
12 - 17 
18 - 23 
24 - 29 
30 - 35 
> startStop(42, 83, 5)
42 - 47 
48 - 53 
54 - 59 
60 - 65 
66 - 71 
72 - 77 
78 - 83 
> startStop(61, 90, 5)
61 - 66 
67 - 72 
73 - 78 
79 - 84 
85 - 90 



--
View this message in context: 
http://r.789695.n4.nabble.com/split-rows-by-range-tp4702415p4702436.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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