Re: [R] data extraction

From: Andris Jankevics <andza_at_osi.lv>
Date: Fri 30 Jun 2006 - 21:52:31 EST

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]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jul 01 01:21:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 01 Jul 2006 - 02:14:09 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.