📅  最后修改于: 2022-03-11 14:59:03.642000             🧑  作者: Mango
scramble <- function(x) x[sample(nrow(x)), ]
subscramble <- function(x, condition) {
scramble(subset(x, condition))
}
subscramble(mtcars, cyl == 4)