Skip to contents

add_group() groups data by one or more columns.

Usage

add_group(dat, group_names)

Arguments

dat

a raw_data object. Output of read_data() function.

group_names

a single character string or character vector specifying the names of the columns to group the data by.

Value

raw_data object.

See also

Examples

path <- get_example_data("small_biocrates_example.xls")
dat <- read_data(path)
dat <- add_group(dat, "group")

dat <- add_group(dat, c("group", "species"))
#> Warning: You already have grouping defined in your data. It will be replaced!