[R] how to get empty sequence for certain bounds

Berton Gunter gunter.berton at gene.com
Wed Nov 15 18:52:07 CET 2006


... seq(a, b, length = ifelse(a <= b, b - a + 1, 0))

seq(a,b,length = max(0,b-a+1))

seems a bit simpler and more transparent.

-- Bert

Bert Gunter
Genentech Nonclinical Statistics
South San Francisco, CA 94404



More information about the R-help mailing list