Created
September 13, 2021 17:58
-
-
Save orrymr/adf295dcd6b30833118ea16a9ed6c010 to your computer and use it in GitHub Desktop.
This file contains 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
#roll, as in roll di(c)e | |
# m = number of times | |
# n = number of dice | |
roll <- function(m, n){ | |
set.seed(1234) | |
means <- plyr::ldply(1:m, function(x){ | |
return(mean(sample(1:6, n, replace = TRUE))) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment