The bootstrap()
function is deprecated and will be removed from
an upcoming release of broom. For tidy resampling, please use the rsample
package instead.
bootstrap(df, m, by_group = FALSE)
a data frame
number of bootstrap replicates to perform
If TRUE
, then bootstrap within each group if df
is
a grouped tbl.
This code originates from Hadley Wickham (with a few small corrections) here:
https://github.com/hadley/dplyr/issues/269
# NOT RUN {
# }
# NOT RUN {
library(dplyr)
mtcars %>% bootstrap(10) %>% do(tidy(lm(mpg ~ wt, .)))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab