selectdata: selectdata - select records from the sessf data

Description Usage Arguments Value Examples

View source: R/cpuefuncs.r

Description

selectdata - select records from the sessf data based upon whether ther edependent variable is empty or not, depth range, years, SESSF zones, fishing method, and fishery. If any are omitted then all records will be used

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
selectdata(
  indat,
  dependent = "LnCE",
  Ldepth = 0,
  Udepth = 1000,
  startyear = 0,
  finalyear = 3000,
  inzones = NA,
  ORzone = NA,
  sharkzone = NA,
  method = NA,
  fishery = NA
)

Arguments

indat

the data set to be filtered - usually sps

dependent

- the dependent variable in the standardization, defaults to LnCE

Ldepth

the lower depth bound - defaults to 0

Udepth

the upper depth bound, defaults to 1000

startyear

the first year for inclusion, defaults to 0, which implies the use of all years present

finalyear

the final year for inclusion, defaults to 0

inzones

the sessf zones to be considered, defaults to NA, which implies either ORzone or sharkzone will be used

ORzone

if the species uses the Orange Roughy zones rather than the SESSF zones then use this input variable; defaults to NA

sharkzone

if the species uses the Shark Regions rather than the SESSF zones then use this input variable; defaults to NA

method

the fishing method to be considered, defaults to NA, which implies all methods to be included

fishery

the three letter acronym for eahc fishery to be considered, defaults to NA, which means include all.

Value

a list made up of the filtered data set named 'sps1', and a matrix containing the effect of the filtering on the numbers of observations; named 'nobs'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
data(sps)
sort(unique(sps$Year))
print(range(sps$Depth))
sps$CE <- NA
sps$LnCE <- NA
pick <- which((sps$catch_kg > 0) & (sps$Effort > 0))
sps$CE[pick] <- sps$catch_kg[pick]/sps$Effort[pick]
sps$LnCE[pick] <- log(sps$CE[pick])
out <- selectdata(sps)
sps1 <- out$sps1
nobs <- out$nobs
nobs

## End(Not run)

haddonm/r4cpue documentation built on May 11, 2020, 1:31 a.m.