Comparing with the Original Workflow
Learn about the comparison of infer with the original workflow.
We'll cover the following...
Note that the steps of the infer
workflow so far produce the same results as the original workflow using the rep_sample_n()
function we saw earlier.
In other words, the following two code snippets produce similar results:
Press + to interact
# infer workflow:pennies_sample %>% specify(response = year) %>%generate(reps = 1000 , type = "bootstrap")# Original workflow:pennies_sample %>%rep_sample_n(size = 50, replace = TRUE,reps = 1000)
The pipeline used for exploring the calculate()
function as shown in the below figure:
Press + to interact
After we generate()
many replicates of bootstrap resampling with replacement, we next want to summarize each of the 1,000 resamples of size 50 to a ...