From a0e610c711f50e84e3f04b0eaf05e976043b2849 Mon Sep 17 00:00:00 2001 From: Ernesto Jardim Date: Wed, 18 Dec 2024 17:51:52 +0100 Subject: [PATCH] multisca renamed to scax --- NAMESPACE | 3 +-- NEWS | 2 +- R/a4aFitMCMCs-class.R | 2 +- R/a4aFits-class.R | 2 +- R/fittingFunctions.R | 10 +++++----- man/plot-mfits.Rd | 2 +- man/plot-mmcfits.Rd | 2 +- man/{multisca.Rd => scax.Rd} | 6 +++--- tests/{multisca.R => scax.R} | 16 ++++++---------- 9 files changed, 20 insertions(+), 25 deletions(-) rename man/{multisca.Rd => scax.Rd} (97%) rename tests/{multisca.R => scax.R} (87%) diff --git a/NAMESPACE b/NAMESPACE index 8078578..d26e7ca 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -45,12 +45,12 @@ export(defaultVmod) export(defaultSRmod) export(a4aSCA) export(sca.sa) +export(scax) export(sep.sa) #export(makePrediction) #export(os.32or64bit) #export(os.type) #export(plotIters) - exportClasses(a4aFit) exportClasses(a4aFits) exportClasses(a4aFitResiduals) @@ -66,7 +66,6 @@ exportClasses(SCAPars) exportClasses(a4aStkParams) exportClasses(submodel) exportClasses(submodels) - exportMethods("distr<-") exportMethods("grInvMod<-") exportMethods("grMod<-") diff --git a/NEWS b/NEWS index 6b0ab5f..692e5e6 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ NEW FEATURES - plot for residuals by age -- multisca method to run several sca +- scax method to run several sca - plot for multiple fits - new classes for plural fit objects diff --git a/R/a4aFitMCMCs-class.R b/R/a4aFitMCMCs-class.R index ab2d6c3..0e8c7e5 100644 --- a/R/a4aFitMCMCs-class.R +++ b/R/a4aFitMCMCs-class.R @@ -99,7 +99,7 @@ setMethod("a4aFitMCMCs", signature(object="missing"), #' ) #' } #' myFits <- -#' FLa4a:::multisca( +#' scax( #' FLStocks(ple4), list(FLIndices(ple4.index)), #' fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC() #' ) diff --git a/R/a4aFits-class.R b/R/a4aFits-class.R index e33fc81..647d2d5 100644 --- a/R/a4aFits-class.R +++ b/R/a4aFits-class.R @@ -100,7 +100,7 @@ setMethod("a4aFits", signature(object="missing"), #' ) #' } #' myFits <- -#' FLa4a:::multisca( +#' scax( #' FLStocks(ple4), list(FLIndices(ple4.index)), #' fmodel = fmods, qmodel=qmods, fit="MP" #' ) diff --git a/R/fittingFunctions.R b/R/fittingFunctions.R index db7e765..a6dda61 100644 --- a/R/fittingFunctions.R +++ b/R/fittingFunctions.R @@ -1489,9 +1489,9 @@ fitADMB <- function(fit, wkdir, df.data, stock, indices, full.df, } #' @title Run several stock assessments in a single run -#' @name multisca +#' @name scax #' @docType methods -#' @rdname multisca +#' @rdname scax #' @description Internal method to run several stock assessment fits with different stocks, indices and submodels #' @param stocks an \code{FLStocks} object containing catch and stock information #' @param indicess a list of \code{FLIndices} objects containing survey indices @@ -1504,8 +1504,8 @@ fitADMB <- function(fit, wkdir, df.data, stock, indices, full.df, #' @param combination.all bolean parameter (default is FALSE) to define if a full factorial across all stocks, indices, and submodel is run or just a sequence of runs. #' @param ... all other arguments to be passed to \code{sca} #' @return an \code{a4aFits} or \code{a4aFitSAs} or \code{a4aFitMCMCs} depending on the argument \code{fit} -#' @aliases multisca -# multisca <- function(stocks, indicess, +#' @aliases scax +# scax <- function(stocks, indicess, # fmodel = missing, # qmodel = missing, # srmodel = missing, @@ -1514,7 +1514,7 @@ fitADMB <- function(fit, wkdir, df.data, stock, indices, full.df, # combination.all = FALSE, # ...) -multisca <- function(stocks, indicess, fmodel = missing, qmodel = missing, srmodel = missing, n1model = missing, vmodel = missing, combination.all = FALSE, ...){ +scax <- function(stocks, indicess, fmodel = missing, qmodel = missing, srmodel = missing, n1model = missing, vmodel = missing, combination.all = FALSE, ...){ args <- list(...) diff --git a/man/plot-mfits.Rd b/man/plot-mfits.Rd index 365aa6e..f3e705d 100644 --- a/man/plot-mfits.Rd +++ b/man/plot-mfits.Rd @@ -34,7 +34,7 @@ for(i in 1:6) { ) } myFits <- - FLa4a:::multisca( + scax( FLStocks(ple4), list(FLIndices(ple4.index)), fmodel = fmods, qmodel=qmods, fit="MP" ) diff --git a/man/plot-mmcfits.Rd b/man/plot-mmcfits.Rd index d3f934e..8aeec7d 100644 --- a/man/plot-mmcfits.Rd +++ b/man/plot-mmcfits.Rd @@ -34,7 +34,7 @@ for(i in 1:6) { ) } myFits <- - FLa4a:::multisca( + scax( FLStocks(ple4), list(FLIndices(ple4.index)), fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC() ) diff --git a/man/multisca.Rd b/man/scax.Rd similarity index 97% rename from man/multisca.Rd rename to man/scax.Rd index 3d3561e..bf01733 100644 --- a/man/multisca.Rd +++ b/man/scax.Rd @@ -1,11 +1,11 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/fittingFunctions.R \docType{methods} -\name{multisca} -\alias{multisca} +\name{scax} +\alias{scax} \title{Run several stock assessments in a single run} \usage{ -multisca( +scax( stocks, indicess, fmodel = missing, diff --git a/tests/multisca.R b/tests/scax.R similarity index 87% rename from tests/multisca.R rename to tests/scax.R index 3c14c17..a2b0222 100644 --- a/tests/multisca.R +++ b/tests/scax.R @@ -22,7 +22,7 @@ idxss <- list(FLIndices(ple4.index)) # MP #-------------------------------------------------------------------- -fits <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MP") +fits <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MP") is(fits, "a4aFits") is(fits[[1]], "a4aFit") @@ -32,7 +32,7 @@ is(fits[[1]], "a4aFit") # SA #-------------------------------------------------------------------- -fitsa <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="assessment") +fitsa <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="assessment") is(fitsa, "a4aFitSAs") is(fitsa[[1]], "a4aFitSA") @@ -41,7 +41,7 @@ is(fitsa[[1]], "a4aFitSA") # MCMC #-------------------------------------------------------------------- -fitsm <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC()) +fitsm <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC()) is(fitsm, "a4aFitMCMCs") is(fitsm[[1]], "a4aFitMCMC") @@ -74,10 +74,6 @@ stks.mc <- stks + fitsm length(stks.mc) == length(fitsm) identical(stks.mc[[2]], stks[[1]] + fitsm[[2]]) - - - - #==================================================================== # run fits sca multiple stocks and indices #==================================================================== @@ -89,7 +85,7 @@ idxss[1:j] <- idxss[1] # MP #-------------------------------------------------------------------- -fits <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MP") +fits <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MP") is(fits, "a4aFits") is(fits[[1]], "a4aFit") @@ -99,7 +95,7 @@ is(fits[[1]], "a4aFit") # SA #-------------------------------------------------------------------- -fitsa <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="assessment") +fitsa <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="assessment") is(fitsa, "a4aFitSAs") is(fitsa[[1]], "a4aFitSA") @@ -108,7 +104,7 @@ is(fitsa[[1]], "a4aFitSA") # MCMC #-------------------------------------------------------------------- -fitsm <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC()) +fitsm <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC()) is(fitsm, "a4aFitMCMCs") is(fitsm[[1]], "a4aFitMCMC")