[R] Search list of elements for a specific pattern

2012-06-22 Thread Joshua Budman
Hi, I have a list of mutations, called "mutList", of the form: > head(mutList) Alu 1 AluJ 2 AluJ/F(R)AM 3AluJ/FLAM 4AluJ/FRAM 5 AluJ/monomer 6AluJb It contains about 500 elements and not all of them contain the sequence "Alu". I tried using this code: Alu<-

Re: [R] Splitting Large Data Frame into Two

2012-06-13 Thread Joshua Budman
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. > > Sarah > > On Wed, Jun 13, 2012 at 11:06 AM, Joshua Budman &g

[R] Splitting Large Data Frame into Two

2012-06-13 Thread Joshua Budman
Hi I have a large data frame of the form: a 1 b 2 c 3 And I would like to split this data frame into two separate data frames based on the values in the first column, e.g. a 1 b 2 and c 3 Is there any way of doing this without having to write a different "which" statement for eac

[R] Removing Double Quotations After Using Cbind

2012-06-06 Thread Joshua Budman
Hi, I am trying to process genomics data and the presence of both characters and integers in an array is giving issues. The following is an example: > a<-array(c(2,2,"X",1:3,2:4),dim=c(3,3)) > b<-cbind(a[,1],a[,2]) With the output being: [,1] [,2] [1,] "2" "1" [2,] "2" "2" [3,] "X" "