Create ID variable from one or more variables
Usage
ID_var(
dat,
project,
vars,
name = NULL,
type = "string",
drop = FALSE,
sep = "_",
log_fun = TRUE
)
Arguments
- dat
Primary data containing information on hauls or trips. Table in FishSET database contains the string `MainDataTable`.
- project
Project name.
- vars
Character string, additional column(s) in
dat
that define unique observations.- name
String, name of new ID column.
- type
String, the class type of the new ID column. Choices are `string`` or `integar`. `string` returns a character vector where each column in
vars
is combined and separated bysep
. `integer` returns an integer vector where each value corresponds to a unique group invars
.- drop
Logical, whether to drop columns in
vars
.- sep
Symbol used to combined variables.
- log_fun
Logical, whether to log function call (for internal use).