R/randomize.R

Defines functions randomize

Documented in randomize

#' @title
#' Randomize a Dataframe
#' @example inst/examples/randomize.R
#' @param data A dataframe or tibble.
#' @rdname randomize
#' @export

randomize <-
  function(data) {
    data[
      sample(1:nrow(data),
        size = nrow(data),
        replace = FALSE
      ),
    ]
  }
patelm9/rubix documentation built on Sept. 3, 2021, 10:22 p.m.