Skip to content

Instantly share code, notes, and snippets.

@JoFrhwld
Created July 29, 2017 20:06
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 JoFrhwld/dc10760324f8a2a4838908c16023b169 to your computer and use it in GitHub Desktop.
Save JoFrhwld/dc10760324f8a2a4838908c16023b169 to your computer and use it in GitHub Desktop.
Using purrr to do bootstrap estimation of the mean
library(tidyverse)
replicates <- (1:100000)%>%
map(~sample(faithful$waiting, replace = T))%>%
map(mean)%>%
simplify()
data_frame(replicates = replicates)%>%
ggplot(aes(replicates))+
stat_density()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment