Learn R Programming

ss3sim (version 0.9.0)

case_comp: Write a case file for length- or age-composition data

Description

Use Rcode to write arguments to the disk, which will later be used in a ss3sim simulation.

Usage

case_comp(fleets = 1, Nsamp = NULL, years = NULL, cpar = 2, type, case,
  spp)

Arguments

fleets
Vector of fleet numbers, where the order of fleets will dictate the order of all remaining arguments.
Nsamp
A list of length length(fleets), where each element of the list contains a vector of sample sizes for each year for that given fleet.
years
A list of length length(fleets), where each element of the list contains a vector of years for the given fleet.
cpar
A vector of cpar for each fleet.
type
A character value of "agecomp" or "lcomp", to write age- or length-composition specifications, respectively. Argument can be a vector (e.g., c("agecomp", "lcomp")) if you want the case files to be the same for length
case
The casenumber you want to write to. If case = 1 and type = "agecomp", then the result will be 'agecomp1'.
spp
A vector of character values argument specifying the species.

Examples

Run this code
case_comp(fleets = 1:2, case = 30, spp = "cod",
  Nsamp = list(rep(10, 40), rep(10, 25)),
  years = list(61:100, 76:100), cpar = 2:1, type = "agecomp")
done <- file.remove("agecomp30-cod.txt")

Run the code above in your browser using DataLab