Skip to content
Prev 181693 / 398503 Next

sample unique pairs from a matrix

You could create a new variable containing only the positive values of 
dataf, and sample from that, e.g.
dataf <- matrix(rnorm(36,1,2), nrow=6)
posdata <- dataf[dataf > 0]
sample(posdata, 6, replace=FALSE)

Regards,
Richie.

Mathematical Sciences Unit
HSL


------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}