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
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
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
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
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
Dear all,
I want to use string split to parse column names, however, I am having
some errors that I don't understand.
I see a problem when I try to rbind the output from strsplit.
please let me know if I'm missing something obvious,
thanks,
alison
here are my commands:
>strsplit<-strsplit(as
6 matches
Mail list logo