[R] save a list as a matrix

Robert Ruser robert.ruser at gmail.com
Sat Nov 20 12:46:06 CET 2010


Hi Mohamed,
It works. Thank you very much.

Best,
Robert


2010/11/20  <mohamed.lajnef at inserm.fr>:
> Hi Robert,
>
> Try to do this
>
>  Len <- max(sapply(my.list, length))
>
>  fun1 <- lapply(my.list, function(x){
>      c(x, rep(0, Len))[1:Len]
>  })
>  do.call(rbind, fun1)
>
> M
> Regards



More information about the R-help mailing list