get_groups: Get grouping structure for a given species

View source: R/get_groups.R

get_groupsR Documentation

Get grouping structure for a given species

Description

Get grouping structure based on a data frame of categories. The data frame allows for any number of grouping variables, where each row is a unique entry based on potentially multiple groups.

Usage

get_groups(data, collapsecharacter = "-")

Arguments

data

A data frame with a potentially infinite number of columns and one row per unique entries. Columns can be named anything you desire, but area would be a typical entry.

collapsecharacter

A character value that will be used to paste names together. The default is - and it is NOT recommended to use an underscore because underscores can cause issues in LaTeX.

Value

A vector of unique names based on row entries.

Author(s)

Kelli F. Johnson

Examples

get_groups(data.frame(group = c("North", "South")))
get_groups(data.frame(
  area = c("North", "South"),
depth = c("inshore", "offshore")
))


iantaylor-NOAA/Lingcod_2021 documentation built on Oct. 30, 2024, 6:42 p.m.