run_bam | R Documentation |
Creates a folder in a directory dir_bam
to write BAM files including model-specific files
(.dat, .tpl, and .cxx) a standard admb2r.cpp
file stored in bamExtras
, and a standard
but customizable cleanup.bat
file. Model-specific files are supplied by the user in any one of several different ways
(see Arguments). It temporarily changes the working directory to dir_bam
then calls a shell script to run the BAM model, and changes the working directory back to the previous path.
The function invisibly returns the bam file objects (indicated by return_obj) in a list.
run_bam(
CommonName = NULL,
fileName = "bam",
dir_bam = NULL,
bam = NULL,
dat_file = NULL,
tpl_file = NULL,
cxx_file = NULL,
dat_obj = NULL,
tpl_obj = NULL,
cxx_obj = NULL,
standardize = TRUE,
subset_rdat = list(eq.series = 101, pr.series = 101),
unlink_dir_bam = TRUE,
admb_options = "-nox",
admb2r_obj = admb2r.cpp,
cleanup = list(del = c("*.r0*", "*.p0*", "*.b0*", "*.log", "*.rpt", "*.obj", "*.htp",
"*.eva", "*.bar", "*.tds", "*.o", "tmp_admb", "variance", "*.dep", "*.hes", "*.tmp")),
return_obj = "rdat"
)
CommonName |
Common name of species associated with dat, tpl, and cxx files |
fileName |
Name given to BAM files, not including file extensions. |
dir_bam |
Name of directory to write BAM files to, relative to the working directory. |
bam |
Output of |
dat_file |
dat file path |
tpl_file |
tpl file path |
cxx_file |
cxx file path |
dat_obj |
dat file read in as a character vector with readLines(con=dat_file) |
tpl_obj |
tpl file read in as a character vector with readLines(con=tpl_file) |
cxx_obj |
cxx file read in as a character vector with readLines(con=cxx_file) |
standardize |
Should |
subset_rdat |
list of rdat objects to subset and number of values to retain. This option can substantially decrease rdat file size, without affecting precision of reference point calculations. |
unlink_dir_bam |
Should |
admb_options |
Character string pasted to fileName to build |
admb2r_obj |
Character string containing admb2r C++ code, which is written with |
cleanup |
List object written to |
return_obj |
objects to return from the function. May include one or more of the following "dat", "tpl", "cxx", "rdat". character vector. |
See return_obj
## Not run:
Run a bam model and assign rdat output to object
rdat_AtMe <- run_bam("AtlanticMenhaden")$rdat
rdat_BlSB <- run_bam("BlackSeaBass")$rdat
rdat_BlTi <- run_bam("BluelineTilefish")$rdat
rdat_Cobi <- run_bam("Cobia")$rdat
rdat_GagG <- run_bam("GagGrouper")$rdat
rdat_GrTr <- run_bam("GrayTriggerfish")$rdat
rdat_GrAm <- run_bam("GreaterAmberjack")$rdat
rdat_ReGr <- run_bam("RedGrouper")$rdat
rdat_RePo <- run_bam("RedPorgy")$rdat
rdat_ReSn <- run_bam("RedSnapper")$rdat
rdat_ScGr <- run_bam("ScampGrouper")$rdat
rdat_SnGr <- run_bam("SnowyGrouper")$rdat
rdat_Tile <- run_bam("Tilefish")$rdat
rdat_VeSn <- run_bam("VermilionSnapper")$rdat
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.