From 8fbcc17ff50bbd16d6c0fdd4daf06713e84aae01 Mon Sep 17 00:00:00 2001 From: Iago Mosqueira Date: Sun, 1 Dec 2024 19:54:23 +0100 Subject: [PATCH] Added full dependencies to TMB, spict and stockassessment --- FLfse/DESCRIPTION | 11 +++++------ FLfse/NAMESPACE | 3 +++ FLfse/R/FLfse.R | 13 +++++++++++++ FLfse/R/sam.R | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/FLfse/DESCRIPTION b/FLfse/DESCRIPTION index e6daa74..e52d488 100644 --- a/FLfse/DESCRIPTION +++ b/FLfse/DESCRIPTION @@ -19,12 +19,11 @@ Imports: foreach, stats, utils, - FLCore (>= 2.6.5) -Depends: -Suggests: spict (>= 1.2.1), + FLCore (>= 2.6.5), stockassessment (>= 0.9.0), - TMB, - mgcv, + TMB +Depends: +Suggests: doParallel -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.2 diff --git a/FLfse/NAMESPACE b/FLfse/NAMESPACE index e29527a..7575579 100644 --- a/FLfse/NAMESPACE +++ b/FLfse/NAMESPACE @@ -8,6 +8,9 @@ export(getpars) import(FLCore) import(foreach) import(methods) +import(spict) +import(stockassessment) +importFrom(TMB,sdreport) importFrom(stats,complete.cases) importFrom(stats,plogis) importFrom(stats,weighted.mean) diff --git a/FLfse/R/FLfse.R b/FLfse/R/FLfse.R index 4cf4d55..b23ab87 100644 --- a/FLfse/R/FLfse.R +++ b/FLfse/R/FLfse.R @@ -18,3 +18,16 @@ NULL ### import functions from stats #' @importFrom stats complete.cases plogis weighted.mean NULL + +### import functions from TMB +#' @importFrom TMB sdreport +NULL + +### import all functionality from spict +#' @import spict +NULL + +### import all functionality from stockassessment +#' @import stockassessment +NULL + diff --git a/FLfse/R/sam.R b/FLfse/R/sam.R index 815fa98..8e6ef14 100644 --- a/FLfse/R/sam.R +++ b/FLfse/R/sam.R @@ -1508,7 +1508,7 @@ setMethod(f = "SAM_uncertainty", ##Resample estimated values to get N, F and q ### calculate standard deviations of model parameters - . <- capture.output(sds <- TMB::sdreport(obj = fit$obj, + . <- capture.output(sds <- sdreport(obj = fit$obj, par.fixed = fit$opt$par, getJointPrecision = TRUE)) if (isTRUE(print_screen)) cat(paste0(., sep = "\n"))