[R] creating lists of random matrices
Evan Cooch
evan.cooch at gmail.com
Wed Nov 9 20:12:48 CET 2016
>>
>> Hi,
>>
>> See ?replicate
>>
>> Example:
>>
>> ## Create a list of 5 2x2 matrices
>
>
> Sorry, correction on my reply.
>
> I copied the wrong output, It should be:
>
> > replicate(5, matrix(rnorm(4), 2, 2), simplify = FALSE)
>
Perfect does the trick. Thanks also for the lapply solutions from
others. The replicate approach is more 'transparent' at least to me.
[[alternative HTML version deleted]]
More information about the R-help
mailing list