On 14 Dec 2003, Peter Dalgaard wrote: > 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?):
Only in the examples for strsplit .... > > > 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 > > > > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
