From 2afad88ae7b493f55493072c2f4e1a7e89634c10 Mon Sep 17 00:00:00 2001 From: Arni Magnusson Date: Mon, 8 Aug 2022 20:31:21 +1100 Subject: [PATCH] Use 'stock' instead of 'taxa' --- DESCRIPTION | 2 +- NEWS.md | 6 +++++- R/addDriors.R | 5 ++--- man/addDriors.Rd | 3 +-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a386bec..6f65239 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: SOFIA Version: 2.0.0 -Date: 2022-08-04 +Date: 2022-08-08 Title: Tools to Work with SOFIA Analyses Authors@R: c(person("Rishi", "Sharma", role="aut"), person("Arni", "Magnusson", role=c("aut","cre"), email="thisisarni@gmail.com")) diff --git a/NEWS.md b/NEWS.md index 30da13d..45c30c9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# SOFIA 2.0.0 (2022-08-04) +# SOFIA 2.0.0 (2022-08-08) * Added functions gitRepos(), gitClone(), and gitCloneAll() to list and clone GitHub repositories. @@ -7,6 +7,10 @@ * Added errors and warnings if stock names in catch/effort/priors don't match. +* Simplified addDriors() so it requires only the 'stock' name, not the 'taxa' + name. These names used to be identical, but only 'stock' will be used from now + on. + * Improved plotCat() so it treats the first two columns of the input data frame as stock and year. diff --git a/R/addDriors.R b/R/addDriors.R index 6d0fbc4..0adcd92 100644 --- a/R/addDriors.R +++ b/R/addDriors.R @@ -2,8 +2,7 @@ #' #' Add driors (data and priors) column to \sQuote{stocks} object. #' -#' @param stocks \code{tibble} containing \code{stock}, \code{taxa}, and -#' \code{data}. +#' @param stocks \code{tibble} containing \code{stock} and \code{data}. #' @param priors data frame containing \code{stock}, \code{initial_state}, #' \code{initial_state_cv}, \code{terminal_state}, and #' \code{terminal_state_cv}. @@ -73,7 +72,7 @@ addDriors <- function(stocks, priors, same.priors, shape_prior=2, p <- if(same.priors) match("All", priors$stock) else match(stocks$stock[i], priors$stock) driors[[i]] <- format_driors( - taxa = stocks$taxa[i], + taxa = stocks$stock[i], shape_prior = 2, catch = stocks$data[[i]]$capture, years = stocks$data[[i]]$year, diff --git a/man/addDriors.Rd b/man/addDriors.Rd index e77bada..eef35c0 100644 --- a/man/addDriors.Rd +++ b/man/addDriors.Rd @@ -8,8 +8,7 @@ addDriors(stocks, priors, same.priors, shape_prior = 2, b_ref_type = "k", growth_rate_prior = NA, growth_rate_prior_cv = 0.2, ...) } \arguments{ -\item{stocks}{\code{tibble} containing \code{stock}, \code{taxa}, and -\code{data}.} +\item{stocks}{\code{tibble} containing \code{stock} and \code{data}.} \item{priors}{data frame containing \code{stock}, \code{initial_state}, \code{initial_state_cv}, \code{terminal_state}, and