[R] How to select not continous rows?

David Winsemius dwinsemius at comcast.net
Wed Oct 20 16:01:28 CEST 2010


On Oct 20, 2010, at 9:25 AM, skan wrote:

>
> Hello
>
> How can I select several not continuous rows ?
>
> If I wanted to select rows 1 to 7 I'll write
> mydata[,1:7]
>
> But what if I need to select rows 1 to 5 and 10 to 15?

mydata[ , c(1:5, 10:15) ]

-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list