> dd
[,1] [,2]
[1,] "OP" "SU"
[2,] "XA" "YQ"
sapply( lapply(
+ strsplit(dd, split=""), sort),
+ paste, collapse="")
[1] "OP" "AX" "SU" "QY"
The result is not what I intended since it is a single line.
It should be:
[,1] [,2]
[1,] "OP" "SU"
[2,] "AX" "QY"
--
View this message in conte
dd=rbind(c("OP", "SU"),c("XA", "YQ"))
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-order-each-element-according-to-alphabet-tp3668997p3669194.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
Thank you very much for your reply doctor.
I tried to apply your command to my table but couldn't
Would you please enlighten me on how to do this when 'lets2' is a 4X4 matrix
for example.
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-order-each-element-according-to-alpha
Hi,
There are many more patterns than VL to LV. In fact, too many to be
listed manually.
For example ML should be ordered as LM, QL should be ordered as LQ.
The order is according to the alphabet.
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-order-each-element-ac
Hi there,
I have a large amino acid csv file like this:
input.txt:
P,LV,Q,Z
P,VL,Q,Z
P,ML,QL,Z
There is a problem with this file, since LV and VL are in fact the same
thing.
How do I order each element according to alphabetical order so that the
desired output would look like:
output.txt:
5 matches
Mail list logo