[R] How to generate a list of lists recursively (for bayesm)

Michael Dondrup michael.dondrup at cebitec.uni-bielefeld.de
Tue Mar 28 16:46:37 CEST 2006


Hi Moritz,
you need to initialize your lists somehow, before you can use them (hence the 
error) like:
> regdata1 <- regdata2 <- list()
[some for loops]
I believe it might be cleaner to use c() to concat the lists, as your code 
seems to add lists at the end, than to assign to list elements which do not 
actually exist.

Cheers

Am Tuesday 28 March 2006 14:39 schrieb v.schlecht at arcor.de:
> thanx for the reply.
>
> Sk is a 1067*300 matrix
> att is a 300*15 matrix
> attq8 is a 300*17 matrix
> regdata1 and regdata2 are meant to become my 2 lists of lists by this
> procedure - I actually do not know if they should be initialized in any
> other way as lists of lists and how to do this.
>
>




More information about the R-help mailing list