Group data
add_group.Rdadd_group() groups data by one or more columns.
Arguments
- dat
a
raw_dataobject. Output ofread_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.
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!