convertData: Convert Data

View source: R/convertData.R

convertDataR Documentation

Convert Data

Description

Convert primary single-stock data files into combined data files ready for analysis, such catches.csv, effort.csv, and/or indices.csv.

Usage

convertData(subdir, min.catch = 0.001, quiet = FALSE)

Arguments

subdir

directory containing the primary data files.

min.catch

small numeric constant to use instead of NA or zero catches.

quiet

whether to suppress screen output.

Details

subdir is usually one of "both", "effort", "index", or "neither", generated by the groupData function.

Pass any non-numeric value for min.catch, for example FALSE, to retain NA and zero catch values.

Value

Files are converted inside subdir. As a byproduct, a list is returned, describing the files after conversion.

Note

A primary data file can have a filename such as ‘Yellowtail_snapper_Mexico.csv’ and columns such as stockid|scientificname|commonname|year|catch|stocklong.

The combined data files, such as catches.csv, have the format Year|Unique_Stock_Name_1|Unique_Stock_Name_2|... where, for example, Yellowtail_snapper_Mexico is one column name.

The output files created will depend on whether the data include effort and/or index data. If subdir = "both", a full set of output files will be created: catches.csv, effort.csv, and index.csv.

The functions groupData and convertData are used together: first group, then convert.

Author(s)

Arni Magnusson.

See Also

groupData groups primary data in subdirectories.

SOFIA-package gives an overview of the package.

Examples

## Not run: 
convertData("Data_files_Area_31_3/both")
convertData("Data_files_Area_31_3/effort, quiet=TRUE")

## End(Not run)


sofia-tsaf/SOFIA documentation built on May 31, 2022, 3:31 a.m.