convertData | R Documentation |
Convert primary single-stock data files into combined data files ready for
analysis, such catches.csv
, effort.csv
, and/or
indices.csv
.
convertData(subdir, min.catch = 0.001, quiet = FALSE)
subdir |
directory containing the primary data files. |
min.catch |
small numeric constant to use instead of |
quiet |
whether to suppress screen output. |
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.
Files are converted inside subdir
. As a byproduct, a list is returned,
describing the files after conversion.
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.
Arni Magnusson.
groupData
groups primary data in subdirectories.
SOFIA-package
gives an overview of the package.
## Not run: convertData("Data_files_Area_31_3/both") convertData("Data_files_Area_31_3/effort, quiet=TRUE") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.