Thomas W Blackwell <[EMAIL PROTECTED]> writes: > Murray - > > If you could guarantee that all of the email addresses have > exactly one occurrence of the "@" character in them, then > something like ....snip....
Otherwise, try something like this (I don't think we have a string reversal function anywhere, do we?): > mychar <- scan(what="") 1: I have some email addresses that I would like to sort in reverse 14: lexicographic order so that addresses from the same domain will be 25: grouped together. How might that be done? 32: Read 31 items > >mychar[order(sapply(lapply(strsplit(mychar,""),rev),paste,collapse=""))] [1] "together." "done?" "I" "I" [5] "lexicographic" "grouped" "would" "be" [9] "be" "the" "like" "same" [13] "some" "reverse" "have" "email" [17] "will" "from" "in" "domain" [21] "so" "to" "order" "addresses" [25] "addresses" "that" "that" "that" [29] "might" "sort" "How" > > Hi all, > > > > I have some email addresses that I would like to sort in reverse > > lexicographic order so that addresses from the same domain will be > > grouped together. How might that be done? > > > > Murray > > > > -- > > Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html > > Department of Statistics, University of Waikato, Hamilton, New Zealand > > Email: [EMAIL PROTECTED] Fax 7 838 4155 > > Phone +64 7 838 4773 wk +64 7 849 6486 home Mobile 021 1395 862 > > > > ______________________________________________ > > [EMAIL PROTECTED] mailing list > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > > > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
