FSA - Fisheries stock assessment methods.
RForge.net

FSA

About FSA
Package R docs
News
Download/Files
Check results
SVN access
Installation
Other

News/Changelog

0.2-0 ongoing
bcFuns(): Added.  Still needs to be thoroughly proofed.
FSAsims(): Modified to reflect srSim() change described below.
listSpecies(): Moved internal function out of being within RSDval() and WSval()
    and then added an argument for the data frame containing the species names.
    The hope was that this would correct the "no visible binding" warnings when
    performing RCMD check but it did not.
srModels(): Renamed from stockRecruitModels() to be more consistent with the
    rest of the stock-recruitment functions.
srSim(): Renamed from stockRecruitSim() to be more consistent with the rest of
    the stock-recruitment functions.
vbModels(): Added.
    

0.1-6 23-Aug-10
o completed changing naming convention to "camel" type -- e.g., stockRecruitModels()
    rather than stock.recruit.models().
    
ageComp(): renamed from age.comp().
ageKey(): renamed from age.key().
capHistConvert(): renamed from caphist.convert().
capHistSum(): renames from caphist.sum().
catchCurve(): renamed from catch.curve().
catchCurveSim(): renamed from cc.sim().
chapmanRobson(): renamed from chapman.robson().
coefPlot(): renamed from coefplot().
cohortSim(): renamed from cohort.sim().
emp(): modified for name changes in NCStats.
FroeseWs(): modified for name changes in NCStats.
FSASims(): modified by updating to new names of simulation functions.
gConvert(): renamed from g.convert().
gReshape(): renamed from g.reshape().
growthRadPlot(): renamed from growrad.plot().
lenFreqExpand(): renamed from len.freq.expand().
leslieRandRun(): renamed from leslie.rand.run().  This is an internal function.
leslieSim(): renamed from leslie.sim().
leslieSim2(): renamed from leslie.sim2().
limnoProfilePlot(): renamed from limnoprofile.plot().
lwModelSim(): renamed from lwmodel.sim().
lwPredsComp(): renamed from comp.lwpreds().
mrClosed(): renamed from mr.closed().  Modified for name changes in NCStats.
mrClosed1Sim(): renamed from mr.closed1.sim().
mrOpen(): renamed from mr.open().
psdVal(): renamed from PSDval().
rcumsum(): deleted.  Moved to NCStats package.
rpl(): modified for name changes in NCStats.
rsdVal(): renamed from RSDval().
tictactoeAdd(): renamed from tictactoe.add().  Modified for name changes in NCStats.
vbComp(): renamed from vb.comp().
wetPerim(): renamed from wetperim().
wlgm(): modified for name changes in NCStats.
wrVal(): renamed from WRval().
wsVal(): renamed from WSval().
wsValidate(): renamed from validateWs().  Also modified for name changes in NCStats.
ycPlot(): renamed from ycplot().

0.1-5 20Aug10
o moved to compiling under 2.11.1.
o started changing my naming convention to "camel" type -- e.g., stockRecruitModels()
    rather than stock.recruit.models().  In this version, I am only changing the
    functions that I am working on.  I will change the rest in the next version.
o added an importFrom for nlme as groupedData() was needed for vbDataGen().

age.key(): Modified the way that the length categories in the age-length key
    is determined.  Previously I just used the rownames found in the key, but
    this allows lengths with a row of all NA or zeroes to be considered as a
    length found in the age length key.  Now the row sums are found and the
    sums with NaN or 0 are removed.  In addition, I added a warning message
    if the row sums do not sum to 1.
caphist.convert(): Modified such that an "RMark" type can be output.
chapmanPlot(): Added.
growmodel.sim(): Deleted.  Changed to growthModelSim().  See below.
growthModelSim(): Added.  Initially a renaming of growmodel.sim().  However, the
    model names were changed to be more consistent with other functions and a
    method for the Mooij et al. paramaterization was added.
growthModels(): Added.
srFuns(): Added.
srStarts(): Added.
stock.recruit(): Deleted, along with all related generics.
stock.recruit.sim(): Deleted.  Changed to stockRecruitSim().  See below.
stockRecruitModels(): Added.
stockRecruitSim():  Initially a renaming of stock.recruit.sim.  However, added
    a "formula" method which required adding generic and default methods.  Changed
    the order of the S and R arguments.  Re-ordered, modified, and added models
    in accordance with the vignette.  Updated the Rd file to reflect these changes
    and made a very slight modification to the examples and added an example to
    illustrate the use of the formula.  Found decent default values for simulations.
stockRecruitSim.default(): Added.  See above.
stockRecruitSim.formula(): Added.  See above.
vbDataGen(): Added.
vbFuns(): Added.
vbStarts(): Added.
walfordPlot(): Added.


0.1-4 6Jun10
growmodel.sim(): added an option to fit the "original" von Bertalanffy function.
    also added more "mis-spelling" options to the other model names.   

0.1-2 17Dec09
o moved to compiling under 2.10.1.

FSA-package(): updated.
o added a dependency to tcltk so that simulators would work properly upon load of FSA.
age.comp(): added xlim= and ylim= arguments so user can control x- and y-axis limits
    if desired.  Changed code so that better choices for axis limits are selected
    automatically if xlim and ylim are both NULL.  Changed code so that the "extra"
    vertical space added when show.n=TRUE AND ylim is NLL is 10 percent of the y-axis
    range rather than just an extra one unit.  Allowed function to work better with
    xaxt="n" and yaxt="n" in case the user wants to create their own axes.  Removed
    a par() setting within the plotting function.  Thanks to David A. Hewitt for
    pointing out the deficiences with the axis labeling.
age.key(): corrected how the age column is labeled if the column did not already
    exist in the data frame.  Was also indirectly modified with lencat() modification.
    Also modified to stop and warn the user if the length sample has fish whose
    lengths are not present in the length-age key (previously there was a warning,
    but then ultimately there was an error).
catch.curve(): added a use.weights= argument to allow using weights in the catch
    curve regression as proposed by Maceina and Bettoli (1998).
chapman.robson(): changed S result from a proportion to a percentage (i.e., *100).
comp.lwpreds(): added center.value= argument to allow centering in the regressions.
    Added an example to the .rd file.
fsa.news(): added to show user the NEWS file.
growmodel.sim(): added the ability to use a formula and data= argument.  Made the
    model argument not have a default value.  Corrected an error when both x and y
    were NULL.  Corrected errors in the Rd file.  Thanks to Jacek Szlakowski for
    pointing out these problems.
lencat(): modified so that an "extra" last length category (with no fish in it) was
    not included when as.fact=TRUE and drop.levels=FALSE is used.  This should correct
    the "problem" of an extra all-NA row in the age-length keys.
tictactoe.add(): added to the namespace export list.  Changed order of items listed
    in the ci.type= argument to match that of bin.ci() from NCStats.


0.1-1 15Apr09
o added a namespace
o removed dependencies and changed to imports ...
    left plotrix and quantreg as dependencies (they do not have a namespaces).
    left reshape as a dependency because of it's dependency on plyr.
    
.FirstLib(): removed (changed to .onLoad() because of namespace).
age.comp(): modified by removing reference to "valid.n" (which is no longer used because of changes
    to Summarize() in NCStats).  Modified to only attempt to compute SE if n>1 and st. dev > 0.
comp.lwpreds(): added.  Exported in namespace.
g.convert(): fixed major error in how the function converted increments to radii.
growrad.plot(): added.  Exported in namespace.
mr.closed(): modified by changing library(Rcapture) to require(Rcapture) in help page.
plot.EMPQ(): modified by changing object$prob to x$prob.
o emp.rd: fixed an incorrect use of Summary() (changed to summary()).
validateWs(): converted sign.slope variable in the Willis metho to a factor to deal with situations
    where all results were positive or negative.
o wlgm.rd: fixed the summarization example (cast() did not work with Summarize().


0.0-14 20Dec08
age.comp(): streamlined code (put bias and difference plots in same function, used grconvertY for show.n,
    used plotCI for range intervals, caught and corrected CI problems when n=1 or SD=0).  No functionality 
    difference, just improved code.
growmodel.sim(): modified by determining some of the slider values from the data when x= and y= arguments are
    not null.  This makes the graph more useful for determining starting values in nls() modeling.

0.0-13 6Dec08
o added a dependency to quantreg (for rq() in emp()).
o added CITATION file.

age.comp(): modified the plot() function by adding a `difference' method to the what= argument.  This allows
    creation of an "age-difference" plot as used in Muir et al. (2008).
caphist.convert(): modified by adding an event.ord= argument to allow the user to identify the order
    of the event names when converting from a capture-by-event type.  This is particulary useful if
    the event names are things like `first', `second', `third', `fourth' because R orders these
    alphabetically which adversely effects the correctness of the capture histories.
compute.Ws(): moved this internal function out of validateWs() to be a stand-alone internal function.  This
    allows usage with animation routines.
discharge(), summary.StrmDschrg(), plot.StrmDschrg(): added.
emp(): added probs= argument result to return list.  Corrected ylab in plotting methods.  Added a predict
    method.  Added a method= argument that allows choice of using linear regression or quantile regression
    to find the Ws equation.  Modified objects in the return list (added rawdata component) and added the
    back-transformed Wq value in regdata (for comparison with Gerow's Excel tool).  Changed code for
    finding summarized dataframes inside the function by using cast() from the reshape package -- this
    resulted in a 3x reduction in system.time().
mr.closed(): modified by correcting error in the multiple census methods if M, n, and m (but not R) were
    supplied.  Also corrected an error in the examples.
rlp(): added probs= argument result to return list.  Corrected ylab in plotting methods.  Added a predict
    method.
PSDval(),RSDval(): added a check for missing species name so that the user can just type PSDval() to get the list of 
    possible species names.  Also added a check to see if RSDlit was already loaded.
validateWs(): added probs= argument result to return list.  Corrected ylab in plotting methods.  Added a predict
    method.  Modified EmpQ() internal function to use predict() methods for emp and rlp objects.  Streamlined
    some of the code by including a compute.Ws() internal function and using the update() function.  Changed code
    for finding summarized dataframes inside the function by using cast() from the reshape package -- this
    resulted in a 1.5x reduction in system.time().
wetperim(),summary.WetPerim(),plot.WetPerim(): added.
wlgm(): major changes included moving some internal functions outside of wlgm(), adding the ability to use
    the data= argument, and adding the ability to fit weighted regressions on the summary statistics.  Other
    minor changes were also made.  Updated the .Rd file.
WSval(),WRval(): added a check for missing species name so that the user can just type WSval() to get the list of 
    possible species names.  Also added a check to see if WSlit was already loaded.


0.0-12  15Jul08
.First.lib: Added
add.zerocatch(): added this function to add zeroes to catch records where a species of fish was not caught.
limnoprofile.plot(): added this function to simplify constructing plots of depth versus limnological measure
    with the depth decreasing from top to bottom.
rlp(): changed default qtype= to 8 (from 7).  Added a probs= argument to allow other than 75th percentile
    calculations.
emp(): updated the help page.  Added a logical for if p.n.low does not exist when using cutoff.tail.  Renamed
    items in the output list.  Added a table of number of individuals per length category to output list.  Added
    a probs= argument to allow other than 75th percentile calculations.  Added its own generics -- rather than
    relying on the rlp() generics.
FroeseWs(): added this function, and its generics, to perform the standard weight equation calculation as
    proposed by Froese (2006).
validateWs(): added this function, and its generics, to perform the Willis and EmpQ methods for assessing length
    bias in the standard weight equations.  Added a probs= argument to allow other than 75th percentile
    calculations.  Added a mean= argument to allow use of means rather than quantiles.  Modified to accept an
    of class FROESE.


0.0-11  15May08
o Moved to RForge.net.
o changed to R2.7.0.
o added a dependency to Rcapture (for the example in caphist.convert).

anova.RLP(): added this function to produce the anova table for the standard weight equation.
caphist.convert(): added this function convert between various capture history formats (FSA,event,MARK,Rcapture).
emp(): added this function, and its generics, to perform Gerow's EmP method for obtaining a standard weight equation.
fit.plot.RLP(): added this function.
plot.RLP(): modified so that color palette with a gradient rather than only a solid color can be used for
    the populations.  In addition, added order.pop= argument that will order the populations from smallest
    to largest predicted with in the first length interval.  When used with the color gradients this will
    make it easier to see which populations cross over other populations.            
rlp(): modified function so that the user can choose to use any-mm length intervals rather than having 10-mm
    hardwired.  Modified output in list somewhat to more closely match the output of emp().


0.0-10  1May08
lencat(): Modified by adding an as.fact= argument that allows the user to decide if the resulting variable
    should be returned as a factor variable or not.  The default is set to return as a factor variable.
    This allows tables of the new variable to include zeroes for levels of the new variable that contain
    no individuals.  This makes some RSD/PSD (and likely age-length key) calculations simpler.  Also added
    a drop.levels= argument to allow the user to drop unused levels if so desired.
mr.closed():  This function is a combination of the old mr.closed1() and mr.closed2().  It also allows the
    user to compute single census estimates with multiple sub-groups in the data (i.e., length- or age-classes).
    The function also allows the user to compute an overall population esitmate of multiple sub-groups are
    present and an overall SE if the incl.SE=TRUE is used.  It also corrects the SE computations implemented
    in version 0.0-9.  This change caused the construction of our internal functions -- mrc1, mrc2, ci.mrc1,
    and ci.mrc2.
mr.closed1(): removed this function.  Use mr.closed() instead.
mr.closed2(): removed this function.  Use mr.closed() instead.
PSDval(): Added mm= argument so that metric result can be returned in mm.  Also added incl.zero= argument
    that will include a zero value in the first position in the vector; this is useful for when creating
    PSD/RSD values.
rcumsum(): Added this function (from NCStats).
RSDval(): See PSDval description.


0.0-9 unknown
age.comp(): Corrected SE calculation used to construct the CIs.  Changed the CI plotting routine to use
    plotCI in plotrix package -- this puts lines rather than points on the ends of the CIs.  Added a check
    for computing SDs and CIs for when n=1 or when all measurements are the same.  This reduces (eliminates?)
    the number of warnings that are given.
catch.curve(): added na.rm=TRUE arguments to min() and max() in plot.CC().  Changed type= argument so that
    "params" is the default rather than "lm".  This makes it more consistent with other simulation programs.
cc.sim(): Put in catch for situations where the CV for No and Z were equal to zero.  Originally, the program
    attempted to computed a random number from a normal distribution with a standard deviation of zero.
    This corrected the problem of no lines appearing unless the CVs were greater than zero.
ch.convert(): STARTED A FUNCTION TO CONVERT B/W CAPTURE HISTORY FORMATS.  NO RD FILE YET.
depletion():  Moved type= argument to third position.  Will more easily allow type="Leslie" as a default
    (i.e., can just enter catch and effort vector.
FSAsims(): Added a "mark-recap" menu section.  Added a chapman 1-sample M-R item to the menu.
leslie.sim(): corrected the conditionals on p.surv and r.prop so that it asks if any not the first value
    is less than 1.  This corrects the problem of R returning a large number of warnings.
leslie.sim2(): corrected the call to depletion() so that the type of model ("Leslie") was the third rather
    than the first argument.  This was caused by a change in the usage of depletion in previous version changes.
mr.closed1(): Modified output list to include an estimate of the variance as described in Ricker(1975).
summary.MRC1(): Modified output so that (1) the given information is a little easier to read, (2) the population
    estimate is returned in a matrix, (3) the SE from Ricker(1975) can be included in the outputm, and (4) a
    label can be placed on row for the matrix output.  The purpose of these changes was to allow the SE to be
    computed and to allow future functions to more flexibly use the output.


0.0-8 unknown
o changed some \items to \tabular in RD files.  Changed most hard-wired quotes to \sQuote or \dQuote in RD files.
    Changed some text-based equations to more latex-based equations in \eqn or \deqn markups.  This fixed the
    Latex compilation problems that I was having when using RCMD check.

age.comp(): Removed single-letter values from the what= argument.  Will rely on partial matching.
age.key(): Changed default name for new column with ages from "Age" to "age".  Added example.
coefplot.WLGM(): Changed to use plotCI() from the plotrix package.  This removed the for loop that I had
    programmed.  This also added the sfrac= and gap= arguments.  Updated the RD.
depletion(): Removed single-letter and lower-case values from the type= argument.  Will rely on partial matching.
lencat(): Changed d argument to df.
lenfreq.expand(): Changed d argument to df.
mr.open(): Added match.arg functionality to the ci.type and phi.type arguments.
plot.RLP(): Added "object <- x" to allow x to be used inside the curve() function without confusion.
removal(): Removed abbreviated values from the type= argument.  Will rely on partial matching.
rlp(): Added examples from Murphy et al. (1990)
stock.recruit(): Removed abbreviated values from the type= argument -- will rely on partial matching.
    Changed sumtype argument to what.
stock.recruit.sim():  Changed model argument to type and added param argument (to make compatible with
    stock.recruit).  Moved R and S arguments to beginning of argument string (more compatible with
    stock.recruit).  STILL NEED TO ADD SECOND RICKER MODEL.
vb.comp(): Changed d argument to df.
wlgm.RD(): Added example code.  Added some details.


0.0-7 unknown
o changed to compiling under R 2.6.1.
o added FSA.R file that loads the required librarys.
o now depends on MASS package because of the creation of the boxcox.WLGM() function and on the
    plotrix package for elements of ycplot().

add.radcap(): Created this function to add the radius-at-capture to a one-fish-per-line data
    frame of increments.
age.comp(): Added a match.arg() call for the what argument.
age.key(): Corrected =T or =F to =TRUE or =FALSE.
cc.sim(): Corrected the use of z.param with correct use of Z.param.
coefplot(): A new generic function for plotting coefficients from a Weisberg Linear Growth Model analysis.
g.convert(): Changed arguments from data and measure.var to df and in.var.  Included match.arg() for the
    type argument.  Moved type argument as it now has a default.  Added the in.pre argument that allows 
    the user to identify all input variables by a common prefix rather than having to list them out in 
    in.var.  Added the out.pre argument that allows the user to control the prefix for the newly created 
    variables in the output data frame.  Updated help file.
g.reshape(): Changed arguments from data and prefix to df and in.pre.  Deleted the measure.var argument.
    Moved new in.pre argument forward and na.rm argument backward in the argument list.  Used in.pre to 
    identify the measure.var variables to send to the melt function.  If id.var is left blank (and in.pre 
    is not) then id.var is the remaining variables not identified by in.pre.  The val.name argument was 
    set equal to in.pre as the default.
leslie.sim(): Corrected call to old leslie() function with a correct call to depletion() function with
    type="Leslie".
leslie.sim2(): Corrected two calls to old leslie() function with correct calls to depletion() function
    with type="Leslie".
leslie.rand.run(): Moved R Documentation alias to FSA-internal.RD.
mr.closed2(): Forced the function to use the lowess() function in the stats rather than the gplots package
    (which is loaded from NCStats).  Also changed the loess.f argument to f and added the iter argument for
    sending to lowess().
confint.MRO(): Put in a logical catch when printing the confidence intervals because if ci.type="Manly"
    then CIs for B are not computed.
summary.MRO(): Put in a logical catch when printing the estimates because if ci.type="Manly" then SEs are
    not computed.
plot.RLP(): Corrected =T or =F to =TRUE or =FALSE.
wlgm(): Created a method with a number of generics (alias, anova, boxcox, coef, coefplot, confint, ycplot)
    for performing the Weisberg Linear Growth Model.
ycplot(): A new generic function for creating a year-class plot for the Weisberg Linear Growth Model analysis.


0.0-6 unknown
agebias.plot(): deleted and replaced with agecomp and plot.AgeComp functions.
agesunflower.plot(): deleted and replaced with agecomp and plot.AgeComp functions.
agecomp(): a new function that, along with its extractor functions, combines all of the functionality
    of the old age.tests, age.symmetry, agebias.plot, and agesunflower.plot.  Allows for a more 
    seamless comparison of ageing reads.
plot.AgeComp(): an extractor function for objects saved from the agecomp function.  This replaces
    the old agebias.plot and agesunflower.plot functions.
summary.Agecomp(): an extractor function for objects saved from the agecomp function.  This replaces
    the old age.tests and age.symmetry functions.
age.symmetry(): deleted and replaced with agecomp and summary.AgeComp functions.
age.tests(): deleted and replaced with agecomp and summary.AgeComp functions.
cc.sim(): modified graphic to (1) include assumption violation labels on top of the graph and
    (2) label y-axis with "log(Catch)" rather than "ln(Catch)".
delury(): deleted and replaced with depletion function.  See notes for depletion function.
depletion(): created a new function that performs the Leslie or Delury method as determined by a
    user-defined argument to type.  This function replaces the old leslie and delury functions.
    All extractor functions for the class "LeslieDelury" have now been changed to class "Depletion".
plot.Depletion(): correct xlab so that it defaults to "Cumulative Effort" for the Delury method.
leslie(): deleted and replaced with depletion function.  See notes for depletion function.
leslie.sim(): modified graphic to include assumption violation labels on top of the graph.
mr.open(): modified est.N() internal function so that N is set equal to n if N
    if the sample size at time i is larger than the estimated population size at time i then the
    estimated population size is set equal to the observed sample size.  This corrects the problem
    of the N.se calculation attempting to take the square root of a negative number causing the
    mr.open() function to shut down.
pass.removal(): changed name to removal.
removal(): new name for old pass.removal function.
rlp(): new name for old (upper-case) RLP.
RLP(): changed name to (lower-case) rlp.