groupData: Group Data

View source: R/groupData.R

groupDataR Documentation

Group Data

Description

Group primary single-stock data files in subdirectories, depending on what columns each data file contains.

Usage

groupData(dir, quiet = FALSE)

Arguments

dir

directory containing the primary data files.

quiet

whether to suppress screen output.

Value

Files are copied into subdirectories. As a byproduct, a list is returned, describing which subdirectories contain which data files.

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.

In addition, the data file may have columns called best_effort and/or best_index, containing the effort and/or index series to be used in the SOFIA analysis.

This function creates four subdirectories:

  1. both - for data files containing both effort and index data

  2. effort - for data files containing effort data (and possibly also index)

  3. index - for data files containing index data (and possibly also effort)

  4. neither - for data files containing neither effort nor index data

The object returned has an attribute count, showing the number of data files in each subdirectory. The number of original (unique) data files will be:

  both + (effort-both) + (index-both) + neither

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

Author(s)

Arni Magnusson.

See Also

convertData converts primary data to combined data.

SOFIA-package gives an overview of the package.

Examples

## Not run: 
groupData("Data_files_Area_31_3")
groupData("Data_files_Area_31_3", quiet=TRUE)

## End(Not run)


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