Skip to contents

Writes one folder (or workbook) per iteration with the observed data, the settings needed to re-create them, and, separately, the answer key:

Usage

export_data(
  data,
  dir,
  give = c("data_lh", "data"),
  format = "csv",
  answer_key = TRUE,
  aggregate = FALSE,
  zip = FALSE
)

Arguments

data

a floss_data.

dir

output folder (created).

give

what goes into the trainee folders: "data" or "data_lh" (adds the life-history parameters).

format

any of "csv", "xlsx" (needs 'writexl'; one workbook per iteration) and "rds" (one floss_flr.rds per iteration: a list by species of as_flr() objects, i.e. FLQuants of catch, effort and length frequencies, FLIndices and the life-history FLPar, ready for JABBA3 and FLicc).

answer_key

write the answer_key folder.

aggregate

also write the aggregated tables (for teaching): catch_aggregate (by fleet, all fleets, all species), effort_aggregate (by fleet, all fleets), cpue_nominal (catch / effort at the three levels) and lfd_aggregate (by fleet and all fleets, as sampled and raised to the catch); see catch_table() and lfd_aggregate().

zip

also write <dir>.zip.

Value

the folder, invisibly.

Details

<dir>/README.txt, settings.yaml
<dir>/iter_01/catch.csv effort.csv cpue.csv survey.csv lfd.csv bio.csv [lhpars.csv]
<dir>/answer_key/README_answer_key.txt truth.csv status.csv refpts.csv
  catch_true.csv bio_true_age.csv planted_artefacts.csv