Skip to content

Re-sort list of vectors

2 messages · Liaw, Andy, jim holtman

#
You could try using one of the sparse representations of matrices in the
SparseM or Matrix packages.  Both packages have vignettes.

Andy
#
Not that I like loops, but here is a quick and dirty way of doing it:

Result <- list()
for (i in names(x)){
    for (j in names(x[[i]])){
        Result[[j]][[i]] <- x[[i]][[j]]
    }
}
On 8/15/05, Liaw, Andy <andy_liaw at merck.com> wrote: