Skip to content

Instantly share code, notes, and snippets.

@timcdlucas
Created April 8, 2020 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timcdlucas/e5ca6a782a3d051fc05eab1538079ee2 to your computer and use it in GitHub Desktop.
Save timcdlucas/e5ca6a782a3d051fc05eab1538079ee2 to your computer and use it in GitHub Desktop.
look at seeds
norm <- rep(NA, 1e4)
unif <- rep(NA, 1e4)
for(i in seq(1e4)){
set.seed(i)
norm[i] <- rnorm(1)
set.seed(i)
unif[i] <- runif(1)
}
d <- data.frame(norm = norm, unif = unif)
which.max(unif)
which.min(unif)
unif[which.max(unif)]
unif[which.min(unif)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment