# NOT RUN {
bootstraps(mtcars, times = 2)
bootstraps(mtcars, times = 2, apparent = TRUE)
library(purrr)
iris2 <- iris[1:130, ]
set.seed(13)
resample1 <- bootstraps(iris2, times = 3)
map_dbl(resample1$splits,
function(x) {
dat <- as.data.frame(x)$Species
mean(dat == "virginica")
})
set.seed(13)
resample2 <- bootstraps(iris2, strata = "Species", times = 3)
map_dbl(resample2$splits,
function(x) {
dat <- as.data.frame(x)$Species
mean(dat == "virginica")
})
set.seed(13)
resample3 <- bootstraps(iris2, strata = "Sepal.Length", breaks = 6, times = 3)
map_dbl(resample3$splits,
function(x) {
dat <- as.data.frame(x)$Species
mean(dat == "virginica")
})
# }
Run the code above in your browser using DataLab