[R] R: matrix sizes

Uwe Ligges ligges at statistik.uni-dortmund.de
Mon Aug 8 12:51:18 CEST 2005


Clark Allan wrote:

> hi all
> 
> assume that one is doing a simulation. in each iteration one produces a
> vector of results. this vectors length might change for each different
> iteration. how can one construct a matrix that contains all of the
> interation results in a matrix where each of the columns are the outputs
> from the different interations.
> 
> how would have to define the output matrix initally?

Of course, you define it to the maximal_length x number_iterations, but 
in fact you probably want a list rather than a matrix.

Uwe Ligges



> /
> thanking you in advance
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help at 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




More information about the R-help mailing list