get_FN124: Get FN124 - Length Frequency Counts from FN_Portal API

View source: R/get_FN124.R

get_FN124R Documentation

Get FN124 - Length Frequency Counts from FN_Portal API

Description

This function accesses the api endpoint for FN124 records from the FN_Portal. FN124 records contain information about the length frequency by species for each effort in a sample. For most gill netting projects this corresponds to catches within a single panel of a particular mesh size within a net set (gang). Group (GRP) is occasionally included to further sub-divide the catch into user defined groups that are usually specific to the project. This function takes an optional filter list which can be used to return record based on several attributes of the catch including species or group code but also attributes of the effort, the sample or the project(s) that the catches were made in.

Usage

get_FN124(
  filter_list = list(),
  show_id = FALSE,
  to_upper = TRUE,
  uncount = FALSE
)

Arguments

filter_list

list

show_id

When 'FALSE', the default, the 'id' and 'slug' fields are hidden from the data frame. To return these columns as part of the data frame, use 'show_id = TRUE'.

to_upper
  • should the names of the data-frame be converted to upper case?

uncount
  • should the binned data be expanded to represent individual measurements. A FN124 record with sizcnt=5 will be repeated 5 times in the returned data frame.

Details

Use show_filters("fn124") to see the full list of available filter keys (query parameters). Refer to https://intra.glis.mnr.gov.on.ca/fn_portal/api/v1/swagger/ and filter by "fn124" for additional information.

Value

dataframe

Author(s)

Jeremy Holden jeremy.holden@ontario.ca

Examples



fn124 <- get_FN124(list(lake = "ON", year = 2021, spc = "334"))
print(nrow(fn124))

filters <- list(
  lake = "ON",
  protocol = "TWL",
  year = 2021,
  spc = c("061", "121")
)
fn124 <- get_FN124(filters)
print(nrow(fn124))

list(prj_cd = "LOA_IA21_TW1", spc = "121")
fn124 <- get_FN124(filters)
print(nrow(fn124))
head(fn124)

# the uncount argument will expand each row by the value of SIZCNT
# in the original FN124 table:
fn124 <- get_FN124(filters, uncount = TRUE)
print(nrow(fn124))
head(fn124)


AdamCottrill/glfishr documentation built on Aug. 9, 2024, 5:47 p.m.