Re: [R] strsplit help

2012-04-12 Thread Jean V Adams
Alison, You've got two geneids with two periods (instead of just one period). gene.list <- strsplit(as.character(Rumino_Reps_agreeWalign$geneid),"\\.") Rumino_Reps_agreeWalign[sapply(gene.list, length)!=2, ] geneid count_Conser count_NonCons count_ConsSubst count_NCSubst 74

Re: [R] strsplit help

2012-04-12 Thread alison waller
Thanks - I checked through and it looks as if all of the geneids are formatted similarily so I don't know which one would be causing an error. Interestingly, your sapply method works on the same data. So I'm happy although still confused, because the strsplit method worked the other day with a

Re: [R] strsplit help

2012-04-11 Thread Jean V Adams
David, Right you are! Thanks for pointing that out. strsplit <- 1:10 strsplit("With spaces", NULL) strsplit Jean David Winsemius wrote on 04/11/2012 01:17:07 PM: > [image removed] > > Re: [R] strsplit help > > David Winsemius > > to: > > Jean

Re: [R] strsplit help

2012-04-11 Thread David Winsemius
On Apr 11, 2012, at 2:01 PM, Jean V Adams wrote: Alison, Your code works fine on the first six lines of the data that you provided. Rumino_Reps_agreeWalign <- data.frame( geneid = c("657313.locus_tag:RTO_08940", "457412.251848018", "657314.locus_tag:CK5

Re: [R] strsplit help

2012-04-11 Thread Jean V Adams
Alison, Your code works fine on the first six lines of the data that you provided. Rumino_Reps_agreeWalign <- data.frame( geneid = c("657313.locus_tag:RTO_08940", "457412.251848018", "657314.locus_tag:CK5_20630", "657323.locus_tag:CK1_330