GlobalVars | R Documentation |
Function to run at the beginning to define global variables.
GlobalVars( db.file = "..\\Data\\CAMP.mdb", output.dir = "..\\outputs", sql.code.dir = file.path(find.package("campR"), "sql"), samplePeriodCutTime = "04:00:00", max.ok.gap = 2, fishingGapMinutes = 10080, knotMesh = 15, halfConeMulti = 2, sample.size.forkLength = 100, sample.size.forkLengthAndWeight = 100, weight.prop.forkLength = 0.5, forkLength.mean.diff = 10, time.zone = "America/Los_Angeles", Yes.code = 1, No.code = 2, seed = 884, forkLengthCutPoints = data.frame(lifeStage = c("FL1 leq 41mm", "FL2 42-72mm", "FL3 73-110mm", "FL4 geq 111mm"), cutPoints = c(41, 72, 110, 9999)), passageRounder = 4, eff.min.spline.samp.size = 10, unassd.sig.digit = 1, bootstrap.CI.fx = "f.ci", R = 100 )
db.file |
Character string giving the full path and name of the CAMP
Access data base file. Path relative to |
output.dir |
Directory for all output. |
sql.code.dir |
Directory containing all the SQL code required by
|
samplePeriodCutTime |
String giving the sample period cut off for batch
date assignment, in military time. Default value is |
max.ok.gap |
Maximum gap, in hours, that is "okay." Default value is
|
fishingGapMinutes |
Maximum gap, in minutes, that is NOT okay. Default value is 10,080 minutes or 7 days. Gaps in fishing greater than this constitute a "big" gap, and no imputation is performed. The GAM models are unstable for "big" gaps. In these cases, the season is broken into two periods (before and after the gap) and treated as two separate traps. |
knotMesh |
The number of data points required per smoothing spline knot.
Default value is 15. For example, |
halfConeMulti |
The multiplication factor to use for expanding fish
caught during half-cone operations. Default value is |
sample.size.forkLength |
Number of fish with measured fork length
required to assign life stage. Default value is |
sample.size.forkLengthAndWeight |
Number of fish with measured fork
length and weight required to use weight in the assignment of life
stage. Default value is |
weight.prop.forkLength |
The minimum proportion of fish with weight to
fish with fork length in order to use weight in assignment of life stage.
Default value is |
forkLength.mean.diff |
When the number of life stage groups ( |
time.zone |
Time zone to assign to all times. Default value is
|
Yes.code |
Integer defining the code for |
No.code |
Integer defining the code for |
seed |
An integer specifying the seed to use in all functions utilizing
a random draw. Currently set equal to |
forkLengthCutPoints |
A dataframe specifying the groups into which fish
are to be partitioned via forklength. The first column containing text
strings, which must be named |
passageRounder |
An integer specifying the place to which final passage
estimates and confidence intervals should be rounded. For example, a value
of |
eff.min.spline.samp.size |
An integer specifying the number of
efficiency trials required to fit a spline efficiency model. If fewer than
this number of efficiency trials target a particular subsite, the Platform
estimates constant efficiency for that subsite using the ROM method (see
|
unassd.sig.digit |
A positive integer specifiying the number of
significant digits to which unassigned fish should be estimated during the
plus-count algorithm. Values other than zero allow for fractional
representation of less common fish types (e.g., Winter or Smolt) during
passage estimation. For example, when
|
bootstrap.CI.fx |
The function, entered as a character string, to use
for identifying (1 - α)\% bootstrapped confidence bounds for
passage. Current options include |
R |
The number of replicates to use for the bootstrap. Default is
|
One additional global variable is defined. table.names
is a
list containing the mapping of table names in Access to table names in R.
This was set up to facilitate painless table name changes in Access. This
should not change unless tables or table names in Access change. Because
these rarely change, we purposefully left this variable out of the
arguments to GlobalVars
. To change table names, edit the code of
GlobalVars
and recompile the package.
In dataframe forkLengthCutPoints
, cut point intervals are closed on
the right. For example, if the second column of forkLengthCutPoints
contains the integers 37, 59, and 105, then it is assumed that three
forklength intervals are desired. The first will cover (0,37], the second
(37,59], and the third (59,105]. The code assumes maximum forklength to be
included is the maximum number given (i.e., 105 in the example). Cut points
must be set so that the last (and greatest) number is larger than the
maximum forklength to include. It is acceptable to set the last cut point
to a large number, e.g., Inf or 999, to ensure all forklengths are included
in the new grouping scheme.
The Access data base name in use is written to the R log file.
Global variable unassd.sig.digit
allows for more robust estimation of
fish captured with lesser frequencies, e.g., endangered fish for which
estimation of passage is deemed useful. Often, underlying
non-randomly-sampled fish are caught in insufficient quantities to allow
for the estimation of at least one of these special fish types, when
rounded to the nearest fish following the application of underlying
frequency distributions resulting from randomly sampled fish. Manipulation
of the decimal place following the allocation of these unassigned fish
leads to non-zero estimates for rare categories represented in the random
sample.
No return value.
WEST Inc.
## Not run: # ---- Change data base file. GlobalVars(db.file="../../Platform/data/StanislawCAMP.mdb" ) # ---- Change where output goes. GlobalVars(ouput.dir="~/Camp_output" ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.