assign_alk_attributes {halk} | R Documentation |
Assign associated age-length key attributes to a data.frame
Description
This is just a helper function to assign the needed attributes and classes
to a data.frame that is produced by either make_alk
or
make_halk
.
Usage
assign_alk_attributes(
data,
size_col = "length",
age_col = "age",
autobin = TRUE,
size_bin = 1,
min_age = NULL,
plus_group = NULL,
alk_n = NULL,
classes = "alk",
dnorm_params = NULL,
levels = NULL
)
Arguments
data |
A data.frame |
size_col |
Character. Name of the column representing sizes |
age_col |
Character. Name of the column representing ages |
autobin |
Logical to set the attribute of autobin |
size_bin |
Numeric. What is the width of size bins |
min_age |
Numeric. The minimum age that was included in the alk |
plus_group |
Numeric. The age that represents the plus group |
alk_n |
Numeric. The number of samples that went into creating the alk |
classes |
Character. The class that should get prepended to the data.frame class(es) |
dnorm_params |
The value of parameters that went into creating the normal distributions on the age groups |
levels |
Character vector of the levels used. This creates the "levels" attribute if present |
Value
A data.frame with associated attributes assigned