read_pax_data: Obtain input data for catch-at-age calculation

Description Usage Arguments Examples

Description

The function reads in the input data, either from the data.frames in the fjolst-package or from the Oracle database and returns a list with three data.frames containing stations, lengths and otoliths.

The data returned are filtered given the specification in the input. E.g. if one were only interested in compiling the catch at age for Bormicon areas 1 and 2 the Region data.frame could be specified as Region = data.frame(area=c(1,2),a=c(1,1)).

Each data.frame of the returned data.frame has a column named index that specifies the metier (e.g. v1s1t1).

Usage

1
2
read_pax_data(Year, Species, Gear, Region, Period, synaflokkur,
  Oracle = FALSE)

Arguments

Year

Year

Species

Species code

Gear

data.frame containg gear code in the station table (column name vf) and metier specifications (v) for the corresponding gear.

Region

data.frame containing bormicon area number (column name area) and and metier area specifications (column name a). Note that this is a devation from the original PAX specification for areas, this being based on statistical rectangles.

Period

data.frame containing months( column name month) and metier specifications (column t)

synaflokkur

Numerical vector. Containing sample class limit the catch at age calculation is based on.

Oracle

A boolean flag, if FALSE (default) the data will be obtained from the data.frame in fjolst, if TRUE (not implemented yet) the data will be read from the MRI Oracle data base (requires network connection).

Examples

1
2
3
4
5
6
7
8
9
# Use only longline and gill net and create one gear metier
Gear <- data.frame(vf=c(1,2),v=c(1,1))
# Allocate bormicon area to two metier regions (Northwest and Southwest regions)
Region <- data.frame(area=c(1:16),a=c(1,rep(2,8),1,1,rep(2,5)))
# One time period
Period <- data.frame(month=c(1:12),t=rep(1,12))
require(fjolst) # Need to load fjolst to access the data
samples <- read_pax_data(Year=2014,Species=1,Gear=Gear,Region=Region,Period=Period,synaflokkur=c(2))
unique(samples$stodvar$index)

einarhjorleifsson/pax documentation built on May 16, 2019, 1:30 a.m.