Hi, there:

I am wondering if there is a quick way to "reverse" a list like this:

t0 <- list(a=1, b=1, c=2, d=1)

reverst t0 to t1

> t1
$`1`
[1] "a" "b" "d"

$`2`
[1] "c"


thanks.
-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to