Answers for "stack overflow R susbsetting"

0

stack overflow R susbsetting

scramble <- function(x) x[sample(nrow(x)), ]

subscramble <- function(x, condition) {
  scramble(subset(x, condition))
}

subscramble(mtcars, cyl == 4)
Posted by: Guest on July-10-2020

Browse Popular Code Answers by Language