On 6/6/07, Keun-Hyung Choi <[EMAIL PROTECTED]> wrote: > I'd like to generate many matrices (let's say 100 matrices of 4x4), of which > diagonal elements are being drawn from each set of sample of known > distribution. > > What would be the best way? I've been trying to find any previous threads > for this topic, but haven't been able to find one.
One approach would be: replicate(100, diag(runif(4)), simplify=FALSE) Hadley ______________________________________________ R-help@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 and provide commented, minimal, self-contained, reproducible code.