Re: [R] select integer intervals from a integer space

2011-12-07 Thread Mao Jianfeng
Dear Gene, Thanks a lot for your kindness. > isp <- data.frame(begin=c(1,5,6,15,31,51,102), end=c(7,9,13,21,49,52,109)) > isp > ints = apply(isp, 1, function(x)seq(x[1],x[2])) > ints > ints = do.call(c, ints) > ints > ## option to fix if the regions are overlapping > ## and you don't want overlap

Re: [R] select integer intervals from a integer space

2011-12-07 Thread Gene Leynes
Possibly not the absolutely most efficient answer, but this is probably an answer nonetheless (David, hope I'm not encouraging bad behavior by replying.) isp <- data.frame(begin=c(1,5,6,15,31,51,102), end=c(7,9,13,21,49,52,109)) isp ints = apply(isp, 1, function(x)seq(x[1],x[2])) ints ints = do.ca

Re: [R] select integer intervals from a integer space

2011-12-07 Thread Mao Jianfeng
Dear David, Thanks for your response and warnings. I will obey the rule and be a good citizen. Best, Jian-Feng, Because you have a poorly posted problem. As far as I can tell you have not yet responded constructively to the attempts at clarification of the problem. Cross-posting to this list a

Re: [R] select integer intervals from a integer space

2011-12-07 Thread David Winsemius
On Dec 7, 2011, at 10:11 AM, Mao Jianfeng wrote: Dear r-helpers, I have an one-dimensional integer space (defined by random integer intervals, which overlapped each other or not). I would like to select consecutive integer intervals with specific intra and inter length. Here, an integer inter

[R] select integer intervals from a integer space

2011-12-07 Thread Mao Jianfeng
Dear r-helpers, I have an one-dimensional integer space (defined by random integer intervals, which overlapped each other or not). I would like to select consecutive integer intervals with specific intra and inter length. Here, an integer interval means a set of consecutive increasing integers, d