197159111
A.K.
- Original Message -
From: Joshua Budman
To: Sarah Goslee
Cc: R-help@r-project.org
Sent: Wednesday, June 13, 2012 12:15 PM
Subject: Re: [R] Splitting Large Data Frame into Two
This is a sample of the data:
ID chrom loc.start loc.end
1 MA1B1Cy5 chr1 197
Then:
Set1.names <- c("MA1B1Cy5", "MA5B4Cy5")
Set1.data <- mydata[mydata$ID %in% Set1.names, ]
On Wed, Jun 13, 2012 at 12:15 PM, Joshua Budman wrote:
> This is a sample of the data:
> ID chrom loc.start loc.end
> 1 MA1B1Cy5 chr1 197008581 197026781
> 18 MA1B3Cy5 chr1 197079
This is a sample of the data:
ID chrom loc.start loc.end
1MA1B1Cy5 chr1 197008581 197026781
18 MA1B3Cy5 chr1 197079541 197080381
55 MA5B2Cy5 chr1 197088651 197118071
70 MA5B2Cy5 chr1 197172341 197189641
72 MA5B3Cy5 chr1 197008581 197010601
89 MA5B4Cy5 chr1 19702542
How are you deciding which values in the first column go into which subset?
If you have a vector containing those values, you could use %in% or if
they're determined logically you could use that criterion.
A reproducible example and a bit more information would get you more
concrete answers.
Sar
4 matches
Mail list logo