| add.radcap {FSA} | R Documentation |
Adds a total radius-at-capture column to a one-fish-per-line increments data frame.
add.radcap(df,in.pre="inc",in.var,var.name="radcap")
df |
A data frame containing the growth increment data in one-fish-per-line format. |
in.pre |
A string that represents the common part of the increment variable names. Default is "inc". |
in.var |
A vector of variables in data that do not change. See details. |
var.name |
A string indicating the name of the total radius-at-capture in the new data frame. |
The columns containing the original increment data can be entered in a variety of ways. First, if all columns begin with the same prefix (and no other columns contain that prefix) then the prefix string can be entered into the in.pre argument. Second, a general sequence of column numbers can be entered into the in.var argument with the #:# form (if the columns are contiguous) or as a concatenated vector form if the columns are not contiguous. Third, a concatenated vector of column names can be entered into the in.var argument. Note that one of but not both of in.var or in.pre must be declared by the user.
Note that the computed total radius-at-capture will only be the actual total radius-at-capture if all growth, including plus-growth in the current season, is recorded in the input data frame.
Returns a data frame of increments in one-fish-per-line format with the total radius-at-capture appended in a variable named var.name.
Derek H. Ogle, dogle@northland.edu
data(SMBassWB) head(SMBassWB) # convert radial measurements to increments SMBi1 <- g.convert(SMBassWB,in.pre="anu",type="inc") head(SMBi1) # add the radius-at-capture measurement SMBi1a <- add.radcap(SMBi1,in.pre="inc",var.name="radcap2") head(SMBi1a)