subsetDatras: Subsets a DATRAS object

View source: R/datras.R

subsetDatrasR Documentation

Subsets a DATRAS object

Description

Selects species, gear, years, haul duration from DATRAS object and returns it or save it in an RDS file

Usage

subsetDatras(dat, species = "Gadus morhua", gear = NULL, years = c(1991,
  2014), haulDur = NULL, icesAreas = NULL, out = NULL)

Arguments

dat

DATRAS object, or character containing the filename of an RDS file holding a DATRASraw object

species

character vector, species to keep (latin name). If NULL all species are kept

gear

character vector, gears to keep. If NULL all gears are kept

years

numeric vector, if length is 2 it is the first and last year to keep, if length is 1 only the data of this year are kept. If NULL all years are kept

haulDur

numeric vector of length 2 with the minimum and maxumum haul duration. If NULL all haul durations are kept

icesAreas

character vector, the ICES area codes to keep. If NULL all areas are kept

out

string, filename of the output RDS file

Value

if out is NULL, a DATRASraw object (invisible). If out is character, the filename of the saved RDS file. If the file specified in out exist, the function does not rewrite the file and returns the filename.

Author(s)

alko


alko989/s6model documentation built on Nov. 2, 2023, 10:04 p.m.