Created
November 27, 2019 10:41
-
-
Save MarkZhangTW/c3d21fcc76a822f83fb5ce6cc030a7d2 to your computer and use it in GitHub Desktop.
permute a matrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
permute = function (m) t(apply(X = m, MARGIN = 1, FUN = function(v) v[sample(length(v))])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment