diff --git a/R/convert_output.R b/R/convert_output.R index 06304483..81b90ec9 100644 --- a/R/convert_output.R +++ b/R/convert_output.R @@ -372,6 +372,8 @@ convert_output <- function( grepl(":_[0-9][0-9]$", label) ~ stringr::str_extract(label, "(?<=_)[0-9][0-9]+"), TRUE ~ NA ) + } else if ("fleet_name" %in% colnames(df3)) { + fleet_name } else { fleet }, @@ -1222,8 +1224,13 @@ convert_output <- function( paste0("Some parameters were not found or included in the output file. The following parameters were not added into the new output file: \n", paste(miss_parms, collapse = "\n")) ) } - out_new <- Reduce(rbind, out_list) |> - dplyr::mutate(fleet = fleet_names[fleet]) + out_new <- Reduce(rbind, out_list) + out_new <- out_new |> + dplyr::mutate(fleet = dplyr::case_when( + any(unique(out_new$fleet) %in% fleet_names) ~ fleet, + TRUE ~ fleet_names[fleet] + ) + ) } else if (model %in% c("bam", "BAM")) { #### BAM #### # Extract values from BAM output - model file after following ADMB2R diff --git a/R/plot_biomass.R b/R/plot_biomass.R index 944c5ac1..b5251b4d 100644 --- a/R/plot_biomass.R +++ b/R/plot_biomass.R @@ -78,7 +78,7 @@ plot_biomass <- function( # Filter data for spawning biomass prepared_data <- filter_data( dat = dat, - label_name = "^biomass$|^biomass_retained$|^biomass_dead$", + label_name = "^biomass$", geom = geom, group = group, facet = facet, diff --git a/R/table_landings.R b/R/table_landings.R index 0438227e..a4fea233 100644 --- a/R/table_landings.R +++ b/R/table_landings.R @@ -23,7 +23,7 @@ #' table_landings( #' stockplotr::example_data, #' unit_label = "landings label", -#' group = +#' group = "fleet" #' ) table_landings <- function( dat, diff --git a/data/example_data.rda b/data/example_data.rda index f5547ccb..52fce783 100644 Binary files a/data/example_data.rda and b/data/example_data.rda differ diff --git a/inst/resources/ss3_var_names.csv b/inst/resources/ss3_var_names.csv index a50e4011..13053e5a 100644 --- a/inst/resources/ss3_var_names.csv +++ b/inst/resources/ss3_var_names.csv @@ -91,13 +91,13 @@ SPAWN_RECRUIT,mature_num,mature_abundance TIME_SERIES,mature_num,mature_abundance SPAWN_RECRUIT,raw_dev, TIME_SERIES,bio_all,biomass -TIME_SERIES,bio_smry,biomass_midyear +TIME_SERIES,bio_smry,biomass_reference_age TIME_SERIES,recruit,recruitment TIME_SERIES,smrybio,biomass_midyear TIME_SERIES,smrynum,abundance_midyear -TIME_SERIES,sel(b),biomass -TIME_SERIES,dead(b),biomass_dead -TIME_SERIES,retain(b),biomass_retained +TIME_SERIES,sel(b),catch_selected +TIME_SERIES,dead(b),catch_dead +TIME_SERIES,retain(b),catch_retained TIME_SERIES,sel(n),numbers TIME_SERIES,dead(n),numbers_dead TIME_SERIES,retain(n),numbers_retained diff --git a/man/table_landings.Rd b/man/table_landings.Rd index 7ec21c99..75a0d6cc 100644 --- a/man/table_landings.Rd +++ b/man/table_landings.Rd @@ -68,6 +68,6 @@ table_landings(stockplotr::example_data) table_landings( stockplotr::example_data, unit_label = "landings label", - group = + group = "fleet" ) } diff --git a/man/theme_noaa.Rd b/man/theme_noaa.Rd index 2b77149e..03ace697 100644 --- a/man/theme_noaa.Rd +++ b/man/theme_noaa.Rd @@ -28,4 +28,7 @@ ggplot2::ggplot( ) + ggplot2::geom_point() + theme_noaa() +\dontrun{ + ggplot2::theme_set(stockplotr::theme_noaa()) +} }