getAgeMethod: Get the ageing method used for the age that is agreed to be...

View source: R/getAgeMethod.R

getAgeMethodR Documentation

Get the ageing method used for the age that is agreed to be the best age

Description

Each age read will have an associated age method. This function will attempt to find what ageing method was used for the age thought to represent the best estimate of the age of the otolith.

Usage

getAgeMethod(Pdata, verbose = TRUE)

Arguments

Pdata

A data frame of biological samples originating from the Pacific Fishieries Information Network (PacFIN) data warehouse, which originated in 2014. Data are pulled using sql calls, see PullBDS.PacFIN().

verbose

A logical specifying if output should be written to the screen or not. Good for testing and exploring your data but can be turned off when output indicates information that you already know. The printing of output to the screen does not affect any of the returned objects. The default is to always print to the screen, i.e., verbose = TRUE.

Details

When more than one age estimate matches what is thought to be the best age, then the ageing methods for all ages that match the best age will be returned as a single entry separated by "–". Most often, double reads are performed using the same method but there are cases, e.g., CARE exchanges or research questions on differences between methods, when a single otolith is read using multiple methods. For example, some petrale sole otoliths were read using both surface and break and burn reads.

Value

A vector of characters.

Author(s)

Kelli F. Johnson

Examples

data <- data.frame(
  age1 = 1:10,
  age2 = 10,
  AGE_METHOD1 = "B",
  AGE_METHOD2 = "S",
  FINAL_FISH_AGE_IN_YEARS = 10
)
getAgeMethod(data)
# [1] "S"    "S"    "S"    "S"    "S"    "S"    "S"    "S"    "S"    "B--S"

nwfsc-assess/PacFIN.Utilities documentation built on March 19, 2024, 11:54 p.m.