Hello,

Using seq, I would like to specify a minumum end value, rather than a maximum 
end value.  For example, rather than

> seq(from=0, to=10, by=4)
[1] 0 4 8

I would like to obtain 
[1] 0 4 8 12

I can do that with 
> by.value = 4
> seq(from=0,by=by.value,to=ceiling(10 / by.value)*by.value)
[1]  0  4  8 12

That seems like a somewhat clunky solution, though, and requires an additional 
variable (by.value) that shows up three times.  Is there a more elegant 
solution to this?

Thanks!
Tim

______________________________________________
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