# NOT RUN {
iris %>% group_by(Species) %>%
bootstrap_summarize(3, mean_sepal_length = mean(Sepal.Length))
data(BlueJays, package = "Stat2Data")
BlueJays %>% group_by(KnownSex) %>%
bootstrap_do(
5,
broom::tidy(lm(BillLength ~ Head, data = .))
)
library(ggplot2)
library(dplyr)
mtcars %>% bootstrap_collect(20) %>%
ggplot(aes(hp, mpg)) +
geom_point(data = mtcars) +
geom_smooth(aes(group = .draw), method = "lm", se = FALSE)
# }
# NOT RUN {
library(gganimate)
mtcars %>% bootstrap_collect(20) %>%
ggplot(aes(hp, mpg)) +
geom_point(data = mtcars) +
geom_smooth(aes(group = .draw), method = "lm", se = FALSE) +
transition_states(.draw, 1, 1) +
shadow_mark(color = "gray60", size = 0.3)
# }
Run the code above in your browser using DataLab