mtcars %>% slice_min(cyl,n=1,with_ties=FALSE) slice_sample 随机无重复抽样iris %>% as_tibble() %>% slice_sample(n = 5) slice_sample 随机有重复抽样iris %>% as_tibble() %>% slice_sample(n = 5, replace = TRUE) 每组只取2行...