Title: | ADMB for R Using Scripts or GUI |
---|---|
Description: | A collection of software provides R support for 'ADMB' (Automatic Differentiation Model Builder) and a 'GUI' interface facilitates the conversion of 'ADMB' template code to 'C code' followed by compilation to a binary executable. Stand-alone functions can also be run by users not interested in clicking a 'GUI'. |
Authors: | Jon T. Schnute [aut], Rowan Haigh [aut, cre], Alex Couture-Beil [aut], Anisa Egeli [ctb] |
Maintainer: | Rowan Haigh <[email protected]> |
License: | GPL (>=2) |
Version: | 1.1.7 |
Built: | 2024-11-04 04:18:23 UTC |
Source: | https://github.com/pbs-software/pbs-admb |
Start up the PBSadmb GUI for controlling and running AD Model Builder.
admb(prefix="", wdf="admbWin.txt", pathfile="ADpaths.txt")
admb(prefix="", wdf="admbWin.txt", pathfile="ADpaths.txt")
prefix |
|
wdf |
|
pathfile |
|
The pathfile
has now replaced the optfile
, which no longer
exists as an argument. The pathfile
identifies valid paths, which are
passed to the options manager.
Additionally, the user can change whichever path settings are desired through the GUI.
The package still recognizes the file 'ADopts.txt'
, which has been
demoted to a back-up file that will be saved only when the user pushes the
Save button on the first tab in the GUI.
If ADopts.txt
exists and the options file .PBSadmb
is not
available (i.e. NULL
), then ADopts.txt
will be used on start up
to populate the GUI.
Do not call your pathfile="ADopts.txt"
unless you want to tempt fate.
On UNIX systems, the MinGW compiler and UNIX tools are readily available;
therefore, only the admbpath
(path to ADMB's home directory)
and the path to a text editor are needed.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Alex Couture-Beil, Software Engineer, Victoria BC
Anisa Egeli, former MUC student, Nanaimo BC
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-25
In package PBSadmb:setADpath
,
readADopts
,
readADpaths
,
makeAD
Append summary information or output to a previously created log file.
appendLog(prefix, lines) .win.appendLog(winName="PBSadmb")
appendLog(prefix, lines) .win.appendLog(winName="PBSadmb")
prefix |
|
lines |
|
winName |
|
No explicit value returned. Appends data into a log file
'prefix'.log
.
A wrapper function that can be called from a GUI exists as .win.appendLog
.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:startLog
,
editAD
These functions are wrappers to the PBSmodelling accessor functions that
get/print objects from or put objects into a temporary work environment,
in this case .PBSadmbEnv
. Working objects include PBSadmb
,
which acts as a storage object for some of the functions, and .PBSadmb
,
which controls the options for the user's project.
atget(...) atcall(...) atprint(...) atput(...) alisp(...)
atget(...) atcall(...) atprint(...) atput(...) alisp(...)
... |
For For |
These accessor functions were developed as a response to the CRAN repository policy statement: “Packages should not modify the global environment (user's workspace).”
Objects are retrieved from or sent to the temporary working
environment to/from the place where the function(s) are called.
Additionally, atcall
invisibly returns the object without
transferring, which is useful when the object is a function that the
user may wish to call, for example, atcall(myfunc)()
, or as
arguments in other functions.
Additional wrapper functions to access functions in .PBSadmbEnv
are named with the prefix .win
(none at the moment).
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Offsite, Vancouver BC
Last modified Rd: 2023-11-10
In package PBSmodelling:tget
, and
lisp
Check that the options object '.PBSadmb'
has all required components
and that paths point to actual files on the hard drive.
checkADopts(opts=getOptions(atcall(.PBSadmb)), check=c("admbpath","gccpath","msysbin","editor"), warn=TRUE, popup=FALSE, verify=TRUE) .win.checkADopts(winName="PBSadmb") .win.checkADpath(winName="PBSadmb")
checkADopts(opts=getOptions(atcall(.PBSadmb)), check=c("admbpath","gccpath","msysbin","editor"), warn=TRUE, popup=FALSE, verify=TRUE) .win.checkADopts(winName="PBSadmb") .win.checkADpath(winName="PBSadmb")
opts |
|
check |
|
warn |
|
popup |
|
verify |
|
winName |
|
Boolean value where TRUE
indicates all programs were located in the
specified directories and FALSE
if at least one program cannot be found.
The returned Boolean scalar has two attributes: warn
– named list of test results, and message
– named vector of test results.
A wrapper function that can be called from a GUI exists as .win.checkADopts
.
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:setADpath
,
readADopts
Detect files in the working directory with the specified prefix
and
removes them all, save those with the suffix .tpl
, .dat
, and .pin
.
cleanAD(prefix) .cleanUp(prefix, suffix, files) .cleanUpAgain(winName="cleanWindow") .cleanWD(files) .doCleanAD(winName="cleanWindow") .win.cleanAD(winName="PBSadmb") .win.findClean(winName="cleanWindow")
cleanAD(prefix) .cleanUp(prefix, suffix, files) .cleanUpAgain(winName="cleanWindow") .cleanWD(files) .doCleanAD(winName="cleanWindow") .win.cleanAD(winName="PBSadmb") .win.findClean(winName="cleanWindow")
prefix |
|
suffix |
|
files |
|
winName |
|
Aside from potential garbage files with the specified 'prefix'
, other
files associated with ADMB are detected. Also files '*.tmp'
and '*.bak'
are displayed. Calling 'cleanAD'
invokes the hidden function '.cleanUp'
,
which creates a GUI menu of the potential garbage files. The user can select whichever
files desired for disposal.
Returns nothing. Invokes a GUI menu of potential garbage files.
A wrapper function that can be called from a GUI exists as '.win.cleanAD'
.
.cleanUp
– Anisa Egeli's PBSmodelling::cleanProj
function modified for flexibility..cleanWD
– clean all potential garbage files; Anisa Egeli's function PBSmodelling::cleanWD
..doCleanAD
– Anisa Egeli's PBSmodelling:::.doClean
function modified for file names only.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-25
In package PBSadmb:makeAD
,
runAD
,
readRep
Compile C++ code in 'prefix'.cpp
to create a binary object
file 'prefix'.o
.
compAD(prefix, raneff=FALSE, safe=TRUE, dll=FALSE, debug=FALSE, logfile=TRUE, add=TRUE, verbose=TRUE, pathfile=NULL) .win.compAD(winName="PBSadmb")
compAD(prefix, raneff=FALSE, safe=TRUE, dll=FALSE, debug=FALSE, logfile=TRUE, add=TRUE, verbose=TRUE, pathfile=NULL) .win.compAD(winName="PBSadmb")
prefix |
|
raneff |
|
safe |
|
dll |
|
debug |
|
logfile |
|
add |
|
verbose |
|
pathfile |
|
winName |
|
This function uses the C++ comiler declared in .PBSadmb
. If logfile=TRUE
,
any errors will appear in 'prefix'.log
. If verbose=TRUE
,
they will appear in the R console.
Invisibly returns the shell call and its messages.
A wrapper function that can be called from a GUI exists as .win.compAD
.
The optional pathfile
is offered for use in command (non-GUI) functions.
Users can easily create this file in a text editor.
Note that on UNIX systems, only the admbpath
(actually the path to ADMB's home directory)
and text editor are used because the MinGW compiler (gccpath
) and UNIX tools are already recognised.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-23
In package PBSadmb:convAD
,
linkAD
,
makeAD
,
readADpaths
Convert code in 'prefix'.tpl
to C++ code in 'prefix'.cpp
.
convAD(prefix, raneff=FALSE, safe=TRUE, dll=FALSE, debug=FALSE, logfile=TRUE, add=TRUE, verbose=TRUE, pathfile=NULL) .win.convAD(winName="PBSadmb") .win.checkPrefix(winName="PBSadmb") .win.findTPL(suffix=".tpl",winName="PBSadmb")
convAD(prefix, raneff=FALSE, safe=TRUE, dll=FALSE, debug=FALSE, logfile=TRUE, add=TRUE, verbose=TRUE, pathfile=NULL) .win.convAD(winName="PBSadmb") .win.checkPrefix(winName="PBSadmb") .win.findTPL(suffix=".tpl",winName="PBSadmb")
prefix |
|
raneff |
|
safe |
|
dll |
|
debug |
|
logfile |
|
add |
|
verbose |
|
pathfile |
|
winName |
|
suffix |
|
Invokes the ADMB command tpl2cpp.exe
or tpl2rem.exe
,
if raneff
is FALSE
or TRUE
respectively.
If logfile=TRUE
, any errors will appear in 'prefix'.log
.
If verbose=TRUE
, they will appear in R console.
Invisibly returns the shell call and its messages.
A wrapper function that can be called from a GUI exists as .win.convAD
.
The optional pathfile
is offered for use in command (non-GUI) functions.
Users can easily create this file in a text editor.
Note that on UNIX systems, only the admbpath
(actually the path to ADMB's home directory)
and text editor are used because the MinGW compiler (gccpath
) and UNIX tools are already recognised.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-23
In package PBSadmb:compAD
,
linkAD
,
makeAD
,
readADpaths
Convert text files to the default format of the operating system.
convOS(inam, onam = inam, path = getwd() )
convOS(inam, onam = inam, path = getwd() )
inam |
|
onam |
|
path |
|
Text file(s) formatted in accordance with standards of the operating system.
This function essentially executes a readLines
command followed by a call to writeLines
.
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:copyFiles
,
.addQuotes
Copy files with specified prefixes and suffixes from one location to another.
copyFiles(prefix, suffix=NULL, srcdir=getwd(), dstdir=getwd(), ask=TRUE)
copyFiles(prefix, suffix=NULL, srcdir=getwd(), dstdir=getwd(), ask=TRUE)
prefix |
|
suffix |
|
srcdir |
|
dstdir |
|
ask |
|
This function uses R's list.files
and file.copy
functions.
The pattern recognition tends not to work when given the wildcard character
*
; however, the user may use this character, and the code will interpret it.
Invisibly returns a Boolean vector with names of files that have been copied or not.
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:editAD
An assortment of dot functions to facilitate running PBSadmb.
.addQuotes(str) .asIs(x) .callSys(..., wait=TRUE) .changeWD(wd) .changeWDEnter() .chooseCols(winName="PBSadmb") .getDirName(path) .load.prefix.droplist() .normPath(path, winslash="\\", mustWork=FALSE) .version(x)
.addQuotes(str) .asIs(x) .callSys(..., wait=TRUE) .changeWD(wd) .changeWDEnter() .chooseCols(winName="PBSadmb") .getDirName(path) .load.prefix.droplist() .normPath(path, winslash="\\", mustWork=FALSE) .version(x)
str |
|
x |
|
... |
|
wait |
|
wd |
|
winName |
|
path |
|
winslash |
|
mustWork |
|
Small utility functions that were demoted to a hidden status before CRAN required their documentation.
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-23
In package PBSadmb:admb
In package PBSmodelling:getWinAct
,
getWinVal
,
tget
An environment set aside for PBSadmb.
.PBSadmbEnv
.PBSadmbEnv
A new environment with a .GlobalEnv
parent.
The environment is created in 'zzz.r'
and is used by
PBSadmb
functions 'alisp'
, 'atget'
,
'atput'
, 'atprint'
, and 'atcall'
.
Generated by a call to the base function new.env()
.
In PBSadmb:alisp
,
atget
In PBSmodelling:lisp
,
tget
Edit files associated with specified prefix and suffixes.
editAD(prefix, suffix=c(".tpl",".cpp",".log")) editADfile(fname) .win.editAD(winName="PBSadmb") .win.editPLT()
editAD(prefix, suffix=c(".tpl",".cpp",".log")) editADfile(fname) .win.editAD(winName="PBSadmb") .win.editPLT()
prefix |
|
suffix |
|
fname |
|
winName |
|
Invisibly returns Boolean vector with elements TRUE
if files exist,
FALSE
if they do not.
A wrapper function that can be called from a GUI exists as .win.editAD
.
This function explicitly uses the editor chosen for PBSadmb. PBSmodelling
has another function openFile
that uses Windows file associations
or an application specified with setPBSext
.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:setADpath
,
copyFiles
Links the binary object file 'prefix'.o
to the ADMB libraries and
produces the executable file 'prefix'.exe
.
linkAD(prefix, raneff=FALSE, safe=TRUE, dll=FALSE, debug=FALSE, logfile=TRUE, add=TRUE, verbose=TRUE, pathfile=NULL) .win.linkAD(winName="PBSadmb")
linkAD(prefix, raneff=FALSE, safe=TRUE, dll=FALSE, debug=FALSE, logfile=TRUE, add=TRUE, verbose=TRUE, pathfile=NULL) .win.linkAD(winName="PBSadmb")
prefix |
|
raneff |
|
safe |
|
dll |
|
debug |
|
logfile |
|
add |
|
verbose |
|
pathfile |
|
winName |
|
This function uses the C++ comiler declared in .PBSadmb
. If logfile=TRUE
,
any errors will appear in 'prefix'.log
. If verbose=TRUE
,
they will appear in the R console.
Invisibly returns the shell call and its messages.
A wrapper function that can be called from a GUI exists as .win.linkAD
.
The optional pathfile
is offered for use in command (non-GUI) functions.
Users can easily create this file in a text editor.
Note that on UNIX systems, only the admbpath
(actually the path to ADMB's home directory)
and text editor are used because the MinGW compiler (gccpath
) and UNIX tools are already recognised.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-23
In package PBSadmb:convAD
,
compAD
,
makeAD
,
readADpaths
Essentially a wrapper function that calls in sequence: convAD
,
compAD
, and linkAD
.
makeAD(prefix, raneff=FALSE, safe=TRUE, dll=FALSE, debug=FALSE, logfile=TRUE, add=TRUE, verbose=TRUE, pathfile=NULL) .win.makeAD(winName="PBSadmb") .setPath(pathfile)
makeAD(prefix, raneff=FALSE, safe=TRUE, dll=FALSE, debug=FALSE, logfile=TRUE, add=TRUE, verbose=TRUE, pathfile=NULL) .win.makeAD(winName="PBSadmb") .setPath(pathfile)
prefix |
|
raneff |
|
safe |
|
dll |
|
debug |
|
logfile |
|
add |
|
verbose |
|
pathfile |
|
winName |
|
This function uses the C++ comiler declared in .PBSadmb
. If logfile=TRUE
,
any errors will appear in 'prefix'.log
. If verbose=TRUE
,
they will appear in the R console.
Returns nothing. The three functions called by makeAD
each
return the shell call and its messages.
A wrapper function that can be called from a GUI exists as .win.makeAD
.
Internally to makeAD
, convAD
, compAD
, and linkAD
,
.setPath(pathfile)
sets the temporary environment path to run ADMB.
The optional pathfile
is offered for use in command (non-GUI) functions.
Users can easily create this file in a text editor.
Note that on UNIX systems, only the admbpath
(actually the path to ADMB's home directory)
and text editor are used because the MinGW compiler (gccpath
) and UNIX tools are already recognised.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:convAD
,
compAD
,
linkAD
,
runAD
,
readADpaths
The R package PBSadmb gives complete R support to the external program AD Model Builder, released into the public domain in 2009. The program offers users a remarkably efficient tool for estimating parameters and their uncertainty, based on complex nonlinear statistical models.
In a standard ADMB installation, users would interact with the program via a DOS command shell (in Windows) or a bash shell (in Linux or Mac OS X). The package PBSadmb makes it possible to interact entirely from an R console, as a common interface for all operating systems. A single R script can encapsulate commands to ADMB, as well as all analyses that follow. The package includes protocols for writing code to make the integration between R and ADMB almost seamless.
PBSadmb also provides a Graphical User Interface (GUI) that facilitates the steps required for a complete ADMB analysis. Both new and experienced users can use the GUI for tutorial and educational purposes.
You can obtain PBSadmb from the Comprehensive R Archive Network (CRAN). Always use the current version of PBSadmb with the most recent version of PBSmodelling, another package available from CRAN.
PBSadmb represents just one of a series of R packages developed at the Pacific Biological Station (PBS) in Nanaimo, British Columbia. A more advanced version of PBSadmb might be available on GitHub under PBS Software in the repository pbs-admb. Regardless, a user can install the GitHub version using:
devtools::install_github("pbs-software/pbs-admb/PBSadmb")
Note: not every revision has been checked for CRAN worthiness.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Alex Couture-Beil, Software Engineer, Victoria BC
Maintainer:
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-25
Plot results of an ADMB MCMC simulation using various plot methods.
plotMC(prefix, act="pairs", pthin=1, useCols=NULL) .win.plotMC(winName="PBSadmb")
plotMC(prefix, act="pairs", pthin=1, useCols=NULL) .win.plotMC(winName="PBSadmb")
prefix |
|
act |
|
pthin |
|
useCols |
|
winName |
|
A wrapper function that can be called from a GUI exists as .win.plotMC
.
Use the PBSadmb GUI to explore these plots easily.
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:runMC
,
showADargs
Read ADMB options list into memory from a file.
Write ADMB options list from memory into a file.
readADopts(optfile="ADopts.txt") writeADopts(optfile="ADopts.txt") .initOptions()
readADopts(optfile="ADopts.txt") writeADopts(optfile="ADopts.txt") .initOptions()
optfile |
|
Create a PBSoptions
class object called .PBSadmb
(stored in the
package's working environment PBSadmbEnv
) and read in ADMB options
from an ASCII text file using a load
function that ultimately calls
PBSmodelling::readList
.
Writes the global ADMB options list to a file using the function
PBSmodelling::saveOptions
.
Dot function '.initOptions'
basically calls 'readADopts'
if
it's the first time (i.e., no options are set in the object '.PBSadmb'
in the environment '.PBSadmbEnv'
).
readADopts
– no values returned; reads the ADMB options into the list object '.PBSadmb'
.writeADopts
– returns opts
invisibly; writes the options list object to an ASCII file.
Alex Couture-Beil, Software Engineer, Victoria BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:atget
,
readADpaths
,
setADpath
In package PBSmodelling:getOptions
,
loadOptions
Read or save ADMB paths (admbpath
, gccpath
, msysbin
, editor
) from
or to a simple, 2-column text file where the first column gives the R variable
name and the second column specifies the path (enclosed by double quotation marks “”).
readADpaths(pathfile) saveADpaths(pathfile) .win.readADpaths(winName="PBSadmb") .win.saveADpaths(winName="PBSadmb")
readADpaths(pathfile) saveADpaths(pathfile) .win.readADpaths(winName="PBSadmb") .win.saveADpaths(winName="PBSadmb")
pathfile |
string name of 2-column text file that details the
relevant paths for the R variables |
winName |
|
The simplest way to pass valid paths to the options manager in PBSadmb is to supply a text file in the working directory. This file can be constructed easily using any text editor. An example might look like:
admbpath "C:/Apps/admb_13.2" gccpath "C:/Apps/R/Rtools44/x86_64-w64-mingw32.static.posix" msysbin "C:/Apps/R/Rtools44/usr/bin" editor "C:/Apps/UltraEdit/Uedit32.exe"
On UNIX systems the MinGW compiler and UNIX tools are readily available;
therefore, only the admbpath
(path to ADMB's home directory)
and the path to a text editor are needed.
The user can supply any number of paths in a pathfile
, which are passed to
the options manager; however, only the above four paths are used at present.
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:readADopts
,
convAD
,
compAD
,
linkAD
,
makeAD
Import ADMB-generated report files into R's memory using the names of the report files to name the R-objects.
readRep(prefix, suffix=c(".cor",".rep",".std",".mc.dat"), global=FALSE) .win.readRep(winName="PBSadmb") .win.viewRep(winName="PBSadmb")
readRep(prefix, suffix=c(".cor",".rep",".std",".mc.dat"), global=FALSE) .win.readRep(winName="PBSadmb") .win.viewRep(winName="PBSadmb")
prefix |
|
suffix |
|
global |
|
winName |
|
If the report object is one of c(".cor", ".std", ".mc.dat")
, the
report object is a data frame, otherwise it is a string vector. Multiple
report objects are returned as a list of objects. A single report object is
returned as the object itself.
This function attempts to detect the file format from a number of possibilities.
For example, if the file has the special format recognized by PBSmodelling,
then the function returns a list with named components. The example vonb
included with this package shows how to write the template to get consistent
variable names between ADMB and R. See the User's Guide for complete details.
Invisibly returns the list of report objects. If only one report is imported, a single report object is returned.
A wrapper function that can be called from a GUI exists as .win.readRep
.
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:editAD
Run the executable binary file 'prefix'.exe
that was created by
makeAD
.
runAD(prefix, argvec="", logfile=TRUE, add=TRUE, verbose=TRUE) .win.runAD(winName="PBSadmb")
runAD(prefix, argvec="", logfile=TRUE, add=TRUE, verbose=TRUE) .win.runAD(winName="PBSadmb")
prefix |
|
argvec |
|
logfile |
|
add |
|
verbose |
|
winName |
|
This function typically reads the two files 'prefix'.dat
and 'prefix'.pin
,
although in same cases one or both of these files may not be necessary.
If logfile=TRUE
, output (including error messages, if any) will appear in
'prefix'.log
. If verbose=TRUE
, it will appear in the R console.
Invisibly returns the results of the shell call.
A wrapper function that can be called from a GUI exists as .win.runAD
.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-23
In package PBSadmb:runMC
,
makeAD
,
cleanAD
Run the executable binary file 'prefix'.exe
, created by
makeAD
, to generate MCMC simulations.
runMC(prefix, nsims=2000, nthin=20, outsuff=".mc.dat", logfile=FALSE, add=TRUE, verbose=TRUE) .win.runMC(winName="PBSadmb") .win.run(winName="PBSadmb")
runMC(prefix, nsims=2000, nthin=20, outsuff=".mc.dat", logfile=FALSE, add=TRUE, verbose=TRUE) .win.runMC(winName="PBSadmb") .win.run(winName="PBSadmb")
prefix |
|
nsims |
|
nthin |
|
outsuff |
|
logfile |
|
add |
|
verbose |
|
winName |
|
This function runs 'prefix'.exe
twice, first with the arguments
-mcmc 'nsims' -mcsave 'nthin'
and second with the argument -mceval
.
By default, output goes to the file 'prefix'.mc.dat
, although a user can
specify a different output suffix.
To see this function in action, use the PBSadmb GUI with the example vonb
or
simpleMC
.
Invisibly returns the results of the shell call.
A wrapper function that can be called from a GUI exists as .win.runMC
.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-23
In package PBSadmb:runAD
,
makeAD
,
cleanAD
Creates an options list object detailing the pathways to the ADMB home directory, the GCC home directory, the MSYS (Unix utilities) bin directoy, and the user's preferred text editor. Also keeps track of software versions for ADMB and GCC.
setADpath(admbpath, gccpath, msysbin, editor) setADver(admbver, gccver) .win.setADver(winName="PBSadmb")
setADpath(admbpath, gccpath, msysbin, editor) setADver(admbver, gccver) .win.setADver(winName="PBSadmb")
admbpath |
|
gccpath |
|
msysbin |
|
editor |
|
admbver |
|
gccver |
|
winName |
|
Creates a global, hidden list object called '.PBSadmb'
,
located in the temporary environment .PBSadmbEnv
.
Use the functions atget
, atput
, atcall
, and
atprint
to get, put, call, and print the object .PBSadmb
.
The function alisp
lists all the objects in the .PBSadmbEnv
environment.
These functions replace makeADopts
(deprecated). The old control file called
ADopts.txt
is retained as a backup file system, which is accessed on
R session start-up and first call to the function admb()
to initialize
the contents of the options manager .PBSadmb
and the GUI. However, if a
path file (e.g., ADpaths.txt
) exists, the paths in this file will
override those taken from ADopts.txt
.
Additionally, the ‘Verify’ button always consults the admb version file (if it exists) and the g++ executable to collect version information. If not available, version information is set to an empty string.
Alex Couture-Beil, Software Engineer, Victoria BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:readADopts
,
readADpaths
Set up path information by reading from a pathfile
(default = ADpaths.txt
) and checking that certain executable
files exist.
setupAD(pathfile)
setupAD(pathfile)
pathfile |
|
This program is useful primarily for console-based function calls.
It sets up the background options for PBSadmb functions (convAD
,
compAD
, linkAD
) by reading paths from a file and checking
to make sure that they are valid (i.e., contain certain exectuable files like
tpl2cpp
and g++
). The options are store in a PBSoptions class
objects called .PBSadmb
in the temporary environment .PBSadmbEnv
.
To access the options manager in the temporary working environment, use the PBSadmb
accessor functions (atget
, atput
, atcall
, atprint
). For eample:
atprint(.PBSadmb)
On UNIX systems the MinGW compiler and UNIX tools are readily available;
therefore, only the admbpath
(path to ADMB's home directory)
and the path to a text editor are needed.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-23
In package PBSadmb:readADpaths
,
checkADopts
,
makeAD
Show all arguments available for an ADMB executable in the default text editor.
showADargs(prefix, ed=TRUE) .win.showADargs(winName="PBSadmb") .win.showGUIargs(winName="PBSadmb")
showADargs(prefix, ed=TRUE) .win.showADargs(winName="PBSadmb") .win.showGUIargs(winName="PBSadmb")
prefix |
|
ed |
|
winName |
|
Invisibly returns the argument list.
A wrapper function that can be called from a GUI exists as .win.showADargs
.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:editADfile
,
runAD
Start a log file by removing any previous version and appending header information.
startLog(prefix) .win.startLog(winName="PBSadmb")
startLog(prefix) .win.startLog(winName="PBSadmb")
prefix |
|
winName |
|
No explicit value returned. Writes header lines into a log file
'prefix'.log
.
A wrapper function that can be called from a GUI exists as .win.startLog
.
Jon T. Schnute, Scientist Emeritus, Nanaimo BC
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-24
In package PBSadmb:appendLog
,
editAD
Suggest a directory path from the system PATH
where a
program specified by the user might be located.
suggestPath(progs, ipath = NULL, file_ext = NULL) .win.suggestPath(winName="PBSadmb")
suggestPath(progs, ipath = NULL, file_ext = NULL) .win.suggestPath(winName="PBSadmb")
progs |
|
ipath |
|
file_ext |
|
winName |
|
Determine whether the specified programs can be located on the user's system.
A wrapper function called .win.suggestPath
is used by
the PBSadmb GUI to suggest paths for the ADMB home,
the Windows MinGW home, and an editor.
Returns a logical vector where each element corresponds to a program searched.
If the element is TRUE
, then the program was found on the path,
which is supplied as the name of the vector element.
If the element is FALSE
, the program may exist on the user's system,
but is not in any of the directories specified by the PATH
environment of the system.
The returned vector has a list attribute where each item in the list corresponds to each element in the vector, and shows the results of the search for each of the directories.
A wrapper function '.win.suggestPath'
can be called from a GUI.
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Remote office, Vancouver BC
Last modified Rd: 2024-04-25
In package PBSadmb:setADpath