Learn R Programming

broom (version 0.3.4)

bootstrap: Set up bootstrap replicates of a dplyr operation

Description

Set up bootstrap replicates of a dplyr operation

Usage

bootstrap(df, m)

Arguments

df
a data frame
m
number of bootstrap replicates to perform

Details

This code originates from Hadley Wickham (with a few small corrections) here:

https://github.com/hadley/dplyr/issues/269

Some examples can be found at

https://github.com/dgrtwo/broom/blob/master/vignettes/bootstrapping.Rmd

Examples

Run this code
library(dplyr)
mtcars %>% bootstrap(10) %>% do(tidy(lm(mpg ~ wt, .)))

Run the code above in your browser using DataLab