readAll: Read in All the Data Corresponding to a Specified Reference...

Description Usage Arguments Details Value

View source: R/readAll.R

Description

Read in all the acoustic and midwater trawl data corresponding to the specified row or a reference csv file. Save the data as objects in an RData file.

Usage

1
2
3
4
5
6
7
readAll(
  refdir,
  keyvals,
  keyvars = c("LAKE", "YEAR"),
  rdat = "ACMT",
  refcsv = "Reference"
)

Arguments

refdir

A character scalar giving the directory in which the reference csv file, ref, is located.

keyvals

A vector giving the values of keyvars to identify a single row of the reference csv file, ref.

keyvars

A character vector giving the names of columns in the reference csv file, ref, that will be used to identify a single row, default c("LAKE", "YEAR").

rdat

A character scalar giving the name of the RData file that will be saved containing all of the objects corresponding to the selected row of the reference csv file, ref, default "ACMT".

refcsv

A character scalar giving the name of the reference csv file, ref, default "Reference". The csv file must have the following 10 columns:

  • subdir = a subdirectory of refdir containing all the other subdirectories and files,

  • svsubdir = the Sv subdirectory,

  • tssubdir = the TS subdirectory,

  • optropf = the midwater trawl operations file,

  • trcatchf = the midwater trawl catch file,

  • trlff = the midwater trawl lengths file,

  • keysp1 = the species code for keyfile1,

  • keyfile1 = the age-length csv file for specieskeysp1,

  • keysp2 = the species code for keyfile2,

  • keyfile2 = the age-length csv file for specieskeysp2.

There should also be additional columns for keyvars.

Details

The acoustic and midwater trawl data corresponding to the selected row of the reference csv file are read in and saved as objects in the specified RData file, in subdir. Objects include the scalar rdat; the vectors keyvals and keyvars; and the data frames inputs (the selected row from the reference data); sv and ts (acoustic data); optrop, trcatch, and trlf (midwater trawl data); key1 and key2 (age-length keys, if specified).

Value

A character scalar giving the path of the subdirectory containing all of inputs and outputs for the given keyvars and keyvals.


JVAdams/EchoNet2Fish documentation built on Feb. 15, 2021, 4:27 a.m.