Re: [R] data extraction

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
Date: Fri 30 Jun 2006 - 22:00:56 EST

you need something like:

new.data <- data[seq(10, nrow(data), 10), ]

I hope it helps.

Best,
Dimitris



Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


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

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



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 Fri Jun 30 23:21:49 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 - 00:18:23 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.