[R] data extraction

Andris Jankevics andza at osi.lv
Fri Jun 30 13:52:31 CEST 2006


This should work:

data[seq(1,nrow(data),10),]



Andris

On Piektdiena, 30. JÅ«nijs 2006 14:45, yohannes alazar wrote:
> Dear mailing list I have a data that have 20,000 rows and 20 columns. Io
> wonted to extract the 10th row only. Example the 10th, 20th, 30th
> 40th…..20000 th. can you please help me how do I do that.Than kyou.
> Example is below.
> Inpute:
> AG GG GG AG
> CC CC CC CC
> CT CC CT CT
> GG GG GG GG
> CC CC CC CC
> GG GG GG GG
> CC CC CC CC
> GG CG CG GG
> GG GG GG GG
> *CC CC CC CC*
> AA AG AG AA
> AA AA AA AA
> GG AG AG GG
> GG AG AG GG
> GG GG GG GG
> TT TT TT TT
> AA AG AG AA
> CT CC CT TT
> AG AA AG GG
> *AA AA AG AG*
> AA AA AA AA
> CC CC CC CG
> GG GG GG AG
> CT TT CT CT
> AT AA AT AT
> GG GG GG AG
> CG CC CG GG
> GG GG GG AG
> CC CC CC CT
> GG GG GG GG
> *GG GG AG AG
> *CC CC CC CT
> TT TT TT CT
> AG GG AG AG
> GG GG GG GG
> AG AG AA AA
> AG GG AG AA
> CT TT CT CT
> CT CT CC CT
> *AC CC AC AC*
>
> output
> *CC CC CC CC
> AA AA AG AG
> GG GG GG GG
> AC CC AC AC*
>
> thankyou a lot inadvance!
>
> 	[[alternative HTML version deleted]]



More information about the R-help mailing list