Learn R Programming

mikropml (version 1.6.1)

shuffle_group: Shuffle the rows in a column

Description

Shuffle the rows in a column

Usage

shuffle_group(dat, col_name)

Value

dat with the rows of col_name shuffled

Arguments

dat

a data frame containing col_name

col_name

column name to shuffle

Author

Courtney R Armour, armourc@umich.edu

Examples

Run this code
if (FALSE) {
set.seed(123)
df <- dplyr::tibble(
  condition = c("a", "a", "b", "b"),
  AUC = c(.2, 0.3, 0.8, 0.9)
)
shuffle_group(df, "condition")
}

Run the code above in your browser using DataLab