slipper
slipper copied to clipboard
group_by() functionality
could be cool to add
Do you have an example of a case you'd like to work so I can work from that?
Sorry for not clarifying ... So bootstrapping within each group:
library(slipper)
mtcars %>%
group_by(cyl) %>%
slipper(mean(mpg),B=100)
mtcars %>%
group_by(cyl) %>%
slipper_lm(mpg ~ disp,B=100)
So I think the only way to do this (currently) is to go through each grouping factor:
mtcars %>%
filter(cyl == 6) %>%
slipper(mean(mpg),B=100)
(Please correct me if I am misusing the package and it can already do this.)
No you are definitely right. This would be fun to add. Maybe over the holidays :) I think I just need to write a method for the grouped_df class maybe?
quick hack:
tmp <- mtcars %>%
group_by(cyl) %>%
do(slipper_lm(mpg ~ disp, B = 100, df = .))