how can i obtain random numbers for each column of a matrix?

We can loop over the column with apply and then get use sample

 apply(m1, 2, sample, 1)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top