Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .covrignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
# Exclude a specific file
R/zzz.R
R/check_fims.R
R/use-gtest-template.R
R/use-testthat-template.R
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export(m_landings)
export(m_lengthcomp)
export(m_weight_at_age)
export(multinomial)
export(plot)
export(set_fixed)
export(set_log_throw_on_error)
export(set_random)
Expand Down
8 changes: 4 additions & 4 deletions R/create_default_configurations.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ utils::globalVariables(c(
#'
#' @examples
#' # Load the example dataset and create a FIMS data frame
#' data("data1")
#' fims_frame <- FIMSFrame(data1)
#' data("data_big")
#' fims_frame <- FIMSFrame(data_big)
#'
#' # Create the default model configuration tibble
#' default_configurations <- create_default_configurations(data = fims_frame)
Expand Down Expand Up @@ -106,8 +106,8 @@ create_default_configurations <- function(data, model_family = c("catch_at_age")
dplyr::mutate(module_type = snake_to_pascal(type)) |>
# Set module_type to NA for weight-at-age and age-to-length-conversion
dplyr::mutate(module_type = dplyr::case_when(
type == "weight-at-age" ~ NA_character_,
type == "age-to-length-conversion" ~ NA_character_,
type == "weight_at_age" ~ NA_character_,
type == "age_to_length_conversion" ~ NA_character_,
TRUE ~ module_type
)) |>
# Remove any combinations where the type did not match a known module.
Expand Down
4 changes: 2 additions & 2 deletions R/create_default_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ utils::globalVariables(c(
#' @examples
#' \dontrun{
#' # Load the example dataset and create a FIMS data frame
#' data("data1")
#' fims_frame <- FIMSFrame(data1)
#' data("data_big")
#' fims_frame <- FIMSFrame(data_big)
#'
#' # Create default configurations
#' default_configurations <- create_default_configurations(fims_frame)
Expand Down
20 changes: 10 additions & 10 deletions R/data1.R → R/data_.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#' FIMS input data frame
#'
#' A dataset containing information necessary to run an age-structured stock
#' A data frame containing the information needed to run an age-structured stock
#' assessment model in FIMS. This data was generated using
#' the `ASSAMC` package written for the [model comparison project](
#' www.github.com/NOAA-FIMS/Age_Structured_Stock_Assessment_Model_Comparison).
#' The source code to make this dataset is in `data-raw/data1.R` which is on
#' Github, but won't be local because it's in the .Rbuildignore file.
#' The source code to make this dataset is in `data-raw/data_big.R` which is on
#' GitHub but will not be in your local installation because it is in the
#' .Rbuildignore file.
#'
#' @format
#' A data frame with `r NROW(data1)` observations of `r NCOL(data1)`
#' A data frame with `r NROW(data_big)` observations of `r NCOL(data_big)`
#' variables:
#' \describe{
#' \item{type}{The type of data the row contains. Allowed types
#' include `age`, `length`, `index`, `landings`, `age-to-length-conversion`,
#' and `weight-at-age` data.}
#' \item{type}{The type of input the row contains. Allowed types include
#' `r glue::glue_collapse(fims_input_types, sep = ", ", last = ", and ")`.}
#' \item{name}{A character string providing the name of the information source
#' that the data was collected from, e.g., `"Trawl fishery"`.}
#' that the input was collected from, e.g., `"Trawl fishery"`.}
#' \item{age}{An integer age. Entry can be `NA` if information pertains to
#' multiple ages, e.g., total landings rather than landings of age-4 fish.}
#' \item{length}{A numeric length. Entry can be `NA` if information doesn't
Expand All @@ -24,7 +24,7 @@
#' \item{value}{The measurement of interest.}
#' \item{unit}{A character string specifying the units of `value`. Allowed
#' units for each data type are as follows. `mt` is used for `index`,
#' `landings`, and `weight-at-age` data. `number` or `proportion` are each
#' `landings`, and `weight_at_age` data. `number` or `proportion` are each
#' viable units for the composition data, where the former is the preferred
#' unit of measurement.}
#' \item{uncertainty}{A real value providing a measurement of uncertainty
Expand All @@ -35,4 +35,4 @@
#' }
#' }
#' @source \url{www.github.com/NOAA-FIMS/Age_Structured_Stock_Assessment_Model_Comparison}
"data1"
"data_big"
9 changes: 9 additions & 0 deletions R/fims_input_types.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#' Vector of acceptable FIMS input types
#'
#' A vector of strings that define which input types are allowed in the column
#' labeled `type` in the data slot of a FIMSFrame object. Strings are composed
#' of words separated by underscores, e.g., `"weight_at_age"`.
#'
#' @format
#' A vector of strings.
"fims_input_types"
7 changes: 5 additions & 2 deletions R/fimsfit.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ utils::globalVariables(c(
"estimate", "estimate.x", "estimate.y",
"initial", "initial.x", "initial.y",
"derived_quantity_id",
"distribution", "module_type", "n", "type_id", "values",
"distribution", "gradient",
"log_like_cv",
"module_type", "n", "type_id", "values",
"module_name.x", "module_name.y",
"module_id.x", "module_id.y",
"module_id_init",
"module_type.x", "module_type.y"
"module_type.x", "module_type.y",
"unique_id"
))

# Developers: ----
Expand Down
Loading
Loading