read_mdl: Read in mdl files of cwt recovery data.

Description Usage Arguments Value Examples

Description

Read in mdl files of cwt recovery data.

Usage

1
read_mdl(filenames, fishery.def = NA, comma.delimited = TRUE)

Arguments

filenames

A character vector of the mdl file names.

comma.delimited

A Boolean. The new format has comma delimited recovery data. The old format was not delimeted, but has a 5 column structure. Default is TRUE (for the new format).

Value

A list of two elements. The first element, named dat.mdl, is also a list. Each element of dat.mdl is also a list and represents the data from one mdl file. The second element of the output list, named dat.mdl.long, is a data frame of all the combined mdl files. This latter list element is the preferred source of data for analysis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
mdl.filenames <- list.files(
  path = "../data/2015BPC_fpa_AABM_troll_spfi - 9-20-2016/56FMDL",
  pattern = "MDL$")
mdl.filepath <- paste(
  "../data/2015BPC_fpa_AABM_troll_spfi - 9-20-2016/56FMDL",
  mdl.filenames, sep="/")
dat.mdl <- read_mdl(mdl.filepath)
fisheries.needed <- fishery.def[fishery.def$aabm %in% aabm,]
dat.mdl.long.sub <- dat.mdl$dat.mdl.long[
   dat.mdl$dat.mdl.long$fishery.name %in% fisheries.needed$fishery.name,]

## End(Not run)

MichaelFolkes/ctctools documentation built on May 7, 2019, 4:56 p.m.