Skip to content

Commit

Permalink
update all documentation and functions to reflect name change
Browse files Browse the repository at this point in the history
  • Loading branch information
Schiano-NOAA committed Feb 24, 2025
1 parent bc706f1 commit 781739b
Show file tree
Hide file tree
Showing 24 changed files with 67 additions and 37 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2024
COPYRIGHT HOLDER: satf authors
COPYRIGHT HOLDER: stockplotr authors
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export(plot_recruitment)
export(plot_recruitment_deviations)
export(plot_spawn_recruitment)
export(plot_spawning_biomass)
export(risk_table)
export(table_bnc)
export(table_indices)
export(write_captions)
20 changes: 10 additions & 10 deletions R/exp_all_figs_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ exp_all_figs_tables <- function(
# figures

tryCatch({
satf::plot_recruitment(
stockplotr::plot_recruitment(
dat,
unit_label = recruitment_unit_label,
scale_amount = recruitment_scale_amount,
Expand All @@ -115,7 +115,7 @@ exp_all_figs_tables <- function(


tryCatch({
satf::plot_biomass(
stockplotr::plot_biomass(
dat,
unit_label = biomass_unit_label,
scale_amount = biomass_scale_amount,
Expand All @@ -136,7 +136,7 @@ exp_all_figs_tables <- function(


tryCatch({
satf::plot_landings(dat, unit_label = landings_unit_label, make_rda, rda_dir) |> suppressWarnings() |> invisible()
stockplotr::plot_landings(dat, unit_label = landings_unit_label, make_rda, rda_dir) |> suppressWarnings() |> invisible()

message("Exported plot_landings")

Expand All @@ -146,7 +146,7 @@ exp_all_figs_tables <- function(
})

tryCatch({
satf::plot_recruitment_deviations(dat, end_year, n_projected_years, make_rda, rda_dir) |> suppressWarnings() |> invisible()
stockplotr::plot_recruitment_deviations(dat, end_year, n_projected_years, make_rda, rda_dir) |> suppressWarnings() |> invisible()

message("Exported plot_recruitment_deviations")

Expand All @@ -157,7 +157,7 @@ exp_all_figs_tables <- function(
print(e)
})

# satf::plot_spawn_recruitment(dat,
# stockplotr::plot_spawn_recruitment(dat,
# spawning_biomass_label,
# recruitment_label = recruitment_unit_label,
# end_year,
Expand All @@ -167,7 +167,7 @@ exp_all_figs_tables <- function(
# message("Exported plot_spawn_recruitment")

tryCatch({
satf::plot_spawning_biomass(
stockplotr::plot_spawning_biomass(
dat,
unit_label = spawning_biomass_label,
scale_amount = spawning_biomass_scale_amount,
Expand All @@ -190,7 +190,7 @@ exp_all_figs_tables <- function(
})

# uncomment when this is working properly
# satf::plot_indices(dat,
# stockplotr::plot_indices(dat,
# unit_label = indices_unit_label,
# make_rda,
# rda_dir) |> suppressWarnings() |> invisible()
Expand All @@ -199,7 +199,7 @@ exp_all_figs_tables <- function(

# tables
tryCatch({
satf::table_bnc(dat,
stockplotr::table_bnc(dat,
end_year,
biomass_unit_label,
catch_unit_label,
Expand All @@ -214,7 +214,7 @@ exp_all_figs_tables <- function(
})

tryCatch({
satf::table_indices(dat, make_rda, rda_dir) |> suppressWarnings() |> invisible()
stockplotr::table_indices(dat, make_rda, rda_dir) |> suppressWarnings() |> invisible()

message("Exported table_indices")

Expand All @@ -224,7 +224,7 @@ exp_all_figs_tables <- function(
})

# uncomment when finished
# satf::table_landings(dat) |> suppressWarnings() |> invisible()
# stockplotr::table_landings(dat) |> suppressWarnings() |> invisible()
#
# message("Exported table_landings")
#
Expand Down
4 changes: 2 additions & 2 deletions R/export_rda.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Export a figure or table to rda
#'
#' Export a figure/table, and its caption and alternative text, to an rda object.
#' Typically used after satf::extract_caps_alttext().
#' Typically used after stockplotr::extract_caps_alttext().
#'
#' @param final The final figure (ggplot) or table (flextable) object.
#' @param caps_alttext The object containing a figure's caption and alternative
#' text, in a list, or a table's caption, likely generated with
#' satf::extract_caps_alttext().
#' stockplotr::extract_caps_alttext().
#' @param rda_dir If the user has already created a folder containing .rda
#' files with figures, tables, alt text, and captions, rda_dir represents
#' the location of the folder containing these .rda files ("rda_files").
Expand Down
2 changes: 1 addition & 1 deletion R/extract_caps_alttext.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Extract captions and alternative texts
#'
#' Extract a figure or table's caption and alternative text for usage when
#' generating a figure or table. Typically used before satf::export_rda().
#' generating a figure or table. Typically used before stockplotr::export_rda().
#'
#' @param topic_label A string that describes a figure or table's label. These
#' labels are found in the "label" column of the "captions_alt_text.csv" file
Expand Down
2 changes: 1 addition & 1 deletion R/plot_biomass.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ plot_biomass <- function(
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = end_year)
}
Expand Down
2 changes: 1 addition & 1 deletion R/plot_indices.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ plot_indices <- function(
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = end_year)
}
Expand Down
2 changes: 1 addition & 1 deletion R/plot_landings.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ plot_landings <- function(dat,
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = NULL)
}
Expand Down
2 changes: 1 addition & 1 deletion R/plot_recruitment.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ plot_recruitment <- function(
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = end_year)
}
Expand Down
2 changes: 1 addition & 1 deletion R/plot_recruitment_deviations.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ plot_recruitment_deviations <- function (
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = end_year)
}
Expand Down
2 changes: 1 addition & 1 deletion R/plot_spawn_recruitment.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ plot_spawn_recruitment <- function(
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = end_year)
}
Expand Down
2 changes: 1 addition & 1 deletion R/plot_spawning_biomass.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ plot_spawning_biomass <- function(
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = end_year)
}
Expand Down
2 changes: 1 addition & 1 deletion R/table_afsc_tier.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ table_afsc_tier <- function() {
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = NULL)
}
Expand Down
2 changes: 1 addition & 1 deletion R/table_bnc.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ table_bnc <- function(
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = NULL)
}
Expand Down
2 changes: 1 addition & 1 deletion R/table_indices.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ table_indices <- function(
if (!file.exists(
fs::path(getwd(), "captions_alt_text.csv"))
) {
satf::write_captions(dat = dat,
stockplotr::write_captions(dat = dat,
dir = rda_dir,
year = NULL)
}
Expand Down
2 changes: 1 addition & 1 deletion R/write_captions.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ write_captions <- function(dat, # converted model output object
# for key quantities (e.g., 'start_year' is the placeholder for the
# assessment's start year)
caps_alttext <- utils::read.csv(
system.file("resources", "captions_alt_text_template.csv", package = "satf")
system.file("resources", "captions_alt_text_template.csv", package = "stockplotr")
)

dat <- dat |>
Expand Down
4 changes: 2 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### Start up messages and actions to run for use of satf
### Start up messages and actions to run for use of stockplotr
# Start up message

.onAttach <- function(libname, pkgname){
packageStartupMessage("Thanks for using satf! Please visit the GitHub pages for more information on this package as well as latest developments. If you have any issues or inquires, please use the Issues page on GitHub (https://github.com/nmfs-ost/satf/issues)")
packageStartupMessage("Thanks for using stockplotr! Please visit the GitHub pages for more information on this package as well as latest developments. If you have any issues or inquires, please use the Issues page on GitHub (https://github.com/nmfs-ost/satf/issues)")
}

# Things to load on start up
Expand Down
1 change: 0 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ kable
kableExtra
rda
rda's
satf
4 changes: 2 additions & 2 deletions man/export_rda.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/extract_caps_alttext.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions man/risk_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url: nmfs-ost.github.io/satf/
url: nmfs-ost.github.io/stockplotr/

navbar:

Expand All @@ -15,7 +15,7 @@ navbar:
issue:
text: Issues
icon: fas fa-question-circle fa-lg
href: https://github.com/nmfs-ost/satf/issues
href: https://github.com/nmfs-ost/stockplotr/issues

articles:
text: Articles
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# * https://testthat.r-lib.org/articles/special-files.html

library(testthat)
library(satf)
library(stockplotr)

test_check("satf")
test_check("stockplotr")
4 changes: 2 additions & 2 deletions vignettes/manual.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ This manual is a work in progress. In the meantime, please read the function doc

## Updating alternative text and captions

When a plotting function (e.g., `plot_biomass()`, `table_indices()`, `exp_all_figs_tables()`) is run, placeholders within the plot's associated alternative text and captions are replaced with key quantities (see the [`asar` package's Accessibility vignette](https://nmfs-ost.github.io/asar/articles/accessibility_guide.html) and/or the [`satf::write_captions()` function](https://github.com/nmfs-ost/satf/blob/master/R/write_captions.R) for more details).
When a plotting function (e.g., `plot_biomass()`, `table_indices()`, `exp_all_figs_tables()`) is run, placeholders within the plot's associated alternative text and captions are replaced with key quantities (see the [`asar` package's Accessibility vignette](https://nmfs-ost.github.io/asar/articles/accessibility_guide.html) and/or the [`stockplotr::write_captions()` function](https://github.com/nmfs-ost/stockplotr/blob/master/R/write_captions.R) for more details).

As stated in the [Accessibility vignette's "Your to-do list" section](https://nmfs-ost.github.io/asar/articles/accessibility_guide.html#your-to-do-list), **you should always:**

**1. Check that these alternative texts and captions have been assembled correctly.**

**2. Write the final component of each figure’s alt text.**

Here's how to alter the alternative text and/or captions in `satf`, depending on what you wish to change:
Here's how to alter the alternative text and/or captions in `stockplotr`, depending on what you wish to change:

### Add or Remove Text

Expand Down

0 comments on commit 781739b

Please sign in to comment.