diff --git a/DESCRIPTION b/DESCRIPTION index da7b7a43..31892f71 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tbeptools Title: Data and Indicators for the Tampa Bay Estuary Program -Version: 3.0.0.9006 -Date: 2024-12-03 +Version: 3.0.0.9007 +Date: 2024-12-12 Authors@R: c( person(given = "Marcus", family = "Beck", diff --git a/R/anlz_sedimentaddtot.R b/R/anlz_sedimentaddtot.R index bf3ce4e0..fb5abbd8 100644 --- a/R/anlz_sedimentaddtot.R +++ b/R/anlz_sedimentaddtot.R @@ -14,7 +14,7 @@ #' #' @examples #' anlz_sedimentaddtot(sedimentdata) -anlz_sedimentaddtot <- function(sedimentdata, yrrng = c(1993, 2022), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', param = NULL, pelave = TRUE){ +anlz_sedimentaddtot <- function(sedimentdata, yrrng = c(1993, 2023), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', param = NULL, pelave = TRUE){ # make yrrng two if only one year provided if(length(yrrng) == 1) diff --git a/R/anlz_sedimentave.R b/R/anlz_sedimentave.R index c9d216ff..002c4f92 100644 --- a/R/anlz_sedimentave.R +++ b/R/anlz_sedimentave.R @@ -19,7 +19,7 @@ #' #' @examples #' anlz_sedimentave(sedimentdata, param = 'Arsenic') -anlz_sedimentave <- function(sedimentdata, param, yrrng = c(1993, 2022), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP'){ +anlz_sedimentave <- function(sedimentdata, param, yrrng = c(1993, 2023), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP'){ # add totals sedimentdata <- anlz_sedimentaddtot(sedimentdata, yrrng = yrrng, bay_segment = bay_segment, diff --git a/R/anlz_sedimentpel.R b/R/anlz_sedimentpel.R index be3a2441..d0edbc51 100644 --- a/R/anlz_sedimentpel.R +++ b/R/anlz_sedimentpel.R @@ -21,7 +21,7 @@ #' #' @examples #' anlz_sedimentpel(sedimentdata) -anlz_sedimentpel <- function(sedimentdata, yrrng = c(1993, 2022), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP'){ +anlz_sedimentpel <- function(sedimentdata, yrrng = c(1993, 2023), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP'){ # combine all, take average, get grade out <- anlz_sedimentaddtot(sedimentdata, yrrng = yrrng, bay_segment = bay_segment, funding_proj = funding_proj, pelave = TRUE) %>% diff --git a/R/anlz_sedimentpelave.R b/R/anlz_sedimentpelave.R index cd3b266e..ec845b6e 100644 --- a/R/anlz_sedimentpelave.R +++ b/R/anlz_sedimentpelave.R @@ -15,7 +15,7 @@ #' #' @examples #' anlz_sedimentpelave(sedimentdata) -anlz_sedimentpelave <- function(sedimentdata, yrrng = c(1993, 2022), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP'){ +anlz_sedimentpelave <- function(sedimentdata, yrrng = c(1993, 2023), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP'){ levs <- c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB') diff --git a/R/anlz_tbbimed.R b/R/anlz_tbbimed.R index 407c6c84..9e175cbe 100644 --- a/R/anlz_tbbimed.R +++ b/R/anlz_tbbimed.R @@ -20,7 +20,7 @@ #' @examples #' tbbiscr <- anlz_tbbiscr(benthicdata) #' anlz_tbbimed(tbbiscr) -anlz_tbbimed <- function(tbbiscr, bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB', 'All', 'All (wt)'), rev = FALSE, yrrng = c(1993, 2022)) { +anlz_tbbimed <- function(tbbiscr, bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB', 'All', 'All (wt)'), rev = FALSE, yrrng = c(1993, 2023)) { # sanity checks stopifnot(length(yrrng) == 2) diff --git a/R/benthicdata.R b/R/benthicdata.R index b07102ee..6d9ffc86 100644 --- a/R/benthicdata.R +++ b/R/benthicdata.R @@ -1,6 +1,6 @@ -#' Benthic data for the Tampa Bay Benthic Index current as of 03132024 +#' Benthic data for the Tampa Bay Benthic Index current as of 20241212 #' -#' Benthic data for the Tampa Bay Benthic Index current as of 03132024 +#' Benthic data for the Tampa Bay Benthic Index current as of 20241212 #' #' @format A nested \code{\link[tibble]{tibble}} with 3 rows and 2 variables: #' \describe{ diff --git a/R/sedimentdata.R b/R/sedimentdata.R index 366b13b3..f5f844ef 100644 --- a/R/sedimentdata.R +++ b/R/sedimentdata.R @@ -1,8 +1,8 @@ -#' Sediment data for the Tampa Bay current as of 12142023 +#' Sediment data for the Tampa Bay current as of 20241212 #' -#' Sediment data for the Tampa Bay current as of 12142023 +#' Sediment data for the Tampa Bay current as of 20241212 #' -#' @format A \code{data.frame} with 216627 rows and 24 variables: +#' @format A \code{data.frame} with 226589 rows and 24 variables: #' \describe{ #' \item{ProgramId}{int} #' \item{ProgramName}{chr} diff --git a/R/show_sedimentalratio.R b/R/show_sedimentalratio.R index bd14a78d..04ccf102 100644 --- a/R/show_sedimentalratio.R +++ b/R/show_sedimentalratio.R @@ -28,7 +28,7 @@ #' #' @examples #' show_sedimentalratio(sedimentdata, param = 'Arsenic') -show_sedimentalratio <- function(sedimentdata, param, yrrng = c(1993, 2022), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', lnsz = 1, base_size = 12, plotly = FALSE, family = NA, width = NULL, height = NULL){ +show_sedimentalratio <- function(sedimentdata, param, yrrng = c(1993, 2023), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', lnsz = 1, base_size = 12, plotly = FALSE, family = NA, width = NULL, height = NULL){ # check paramater is an available metal metals <- sedimentdata %>% diff --git a/R/show_sedimentave.R b/R/show_sedimentave.R index 7b86d6e7..f0cb46a3 100644 --- a/R/show_sedimentave.R +++ b/R/show_sedimentave.R @@ -20,7 +20,7 @@ #' #' @examples #' show_sedimentave(sedimentdata, param = 'Arsenic') -show_sedimentave <- function(sedimentdata, param, yrrng = c(1993, 2022), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', lnsz = 1, base_size = 12, plotly = FALSE, family = NA, width = NULL, height = NULL){ +show_sedimentave <- function(sedimentdata, param, yrrng = c(1993, 2023), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', lnsz = 1, base_size = 12, plotly = FALSE, family = NA, width = NULL, height = NULL){ toplo <- anlz_sedimentave(sedimentdata, param = param, yrrng = yrrng, bay_segment = bay_segment, funding_proj = funding_proj) diff --git a/R/show_sedimentmap.R b/R/show_sedimentmap.R index 7de0a52b..600793d4 100644 --- a/R/show_sedimentmap.R +++ b/R/show_sedimentmap.R @@ -17,7 +17,7 @@ #' #' @examples #' show_sedimentmap(sedimentdata, param = 'Arsenic') -show_sedimentmap <- function(sedimentdata, param, yrrng = c(1993, 2022), funding_proj = 'TBEP', weight = 1.5){ +show_sedimentmap <- function(sedimentdata, param, yrrng = c(1993, 2023), funding_proj = 'TBEP', weight = 1.5){ # add totals sedimentdata <- anlz_sedimentaddtot(sedimentdata, yrrng = yrrng, funding_proj = funding_proj, param = param, pelave = FALSE) diff --git a/R/show_sedimentpelave.R b/R/show_sedimentpelave.R index 02f2014e..fe204121 100644 --- a/R/show_sedimentpelave.R +++ b/R/show_sedimentpelave.R @@ -22,7 +22,7 @@ #' #' @examples #' show_sedimentpelave(sedimentdata) -show_sedimentpelave <- function(sedimentdata, yrrng = c(1993, 2022), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', alph = 1, ylim = c(0, 0.4), lnsz = 1, base_size = 12, plotly = FALSE, family = NA, width = NULL, height = NULL){ +show_sedimentpelave <- function(sedimentdata, yrrng = c(1993, 2023), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', alph = 1, ylim = c(0, 0.4), lnsz = 1, base_size = 12, plotly = FALSE, family = NA, width = NULL, height = NULL){ # get avg pel ratios by station, then get averages toplo <- anlz_sedimentpelave(sedimentdata, yrrng = yrrng, bay_segment = bay_segment, funding_proj = funding_proj) diff --git a/R/show_sedimentpelmap.R b/R/show_sedimentpelmap.R index 1b4c4bb8..2fccd20f 100644 --- a/R/show_sedimentpelmap.R +++ b/R/show_sedimentpelmap.R @@ -14,7 +14,7 @@ #' #' @examples #' show_sedimentpelmap(sedimentdata) -show_sedimentpelmap <- function(sedimentdata, yrrng = c(1993, 2022), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', weight = 1.5){ +show_sedimentpelmap <- function(sedimentdata, yrrng = c(1993, 2023), bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB'), funding_proj = 'TBEP', weight = 1.5){ # map prep tomap <- anlz_sedimentpel(sedimentdata, yrrng = yrrng, bay_segment = bay_segment, funding_proj = funding_proj) %>% diff --git a/R/show_tbbimatrix.R b/R/show_tbbimatrix.R index 21f18943..99bbd42a 100644 --- a/R/show_tbbimatrix.R +++ b/R/show_tbbimatrix.R @@ -28,7 +28,7 @@ #' tbbiscr <- anlz_tbbiscr(benthicdata) #' show_tbbimatrix(tbbiscr) show_tbbimatrix <- function(tbbiscr, bay_segment = c('HB', 'OTB', 'MTB', 'LTB', 'TCB', 'MR', 'BCB', 'All', 'All (wt)'), - yrrng = c(1993, 2022), alph = 1, txtsz = 3, family = NA, rev = FALSE, position = 'top', + yrrng = c(1993, 2023), alph = 1, txtsz = 3, family = NA, rev = FALSE, position = 'top', plotly = FALSE, width = NULL, height = NULL){ # annual average by segment diff --git a/data/benthicdata.RData b/data/benthicdata.RData index 3b0f6538..7fb70992 100644 Binary files a/data/benthicdata.RData and b/data/benthicdata.RData differ diff --git a/data/sedimentdata.RData b/data/sedimentdata.RData index 16a21194..d8db9139 100644 Binary files a/data/sedimentdata.RData and b/data/sedimentdata.RData differ diff --git a/man/anlz_sedimentaddtot.Rd b/man/anlz_sedimentaddtot.Rd index 560f9e6d..1405b51f 100644 --- a/man/anlz_sedimentaddtot.Rd +++ b/man/anlz_sedimentaddtot.Rd @@ -6,7 +6,7 @@ \usage{ anlz_sedimentaddtot( sedimentdata, - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB"), funding_proj = "TBEP", param = NULL, diff --git a/man/anlz_sedimentave.Rd b/man/anlz_sedimentave.Rd index 3b60b7a6..e128b085 100644 --- a/man/anlz_sedimentave.Rd +++ b/man/anlz_sedimentave.Rd @@ -7,7 +7,7 @@ anlz_sedimentave( sedimentdata, param, - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB"), funding_proj = "TBEP" ) diff --git a/man/anlz_sedimentpel.Rd b/man/anlz_sedimentpel.Rd index 927f8063..900a4d87 100644 --- a/man/anlz_sedimentpel.Rd +++ b/man/anlz_sedimentpel.Rd @@ -6,7 +6,7 @@ \usage{ anlz_sedimentpel( sedimentdata, - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB"), funding_proj = "TBEP" ) diff --git a/man/anlz_sedimentpelave.Rd b/man/anlz_sedimentpelave.Rd index 466d222f..3f10159f 100644 --- a/man/anlz_sedimentpelave.Rd +++ b/man/anlz_sedimentpelave.Rd @@ -6,7 +6,7 @@ \usage{ anlz_sedimentpelave( sedimentdata, - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB"), funding_proj = "TBEP" ) diff --git a/man/anlz_tbbimed.Rd b/man/anlz_tbbimed.Rd index f07a1173..cbe28bfd 100644 --- a/man/anlz_tbbimed.Rd +++ b/man/anlz_tbbimed.Rd @@ -8,7 +8,7 @@ anlz_tbbimed( tbbiscr, bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB", "All", "All (wt)"), rev = FALSE, - yrrng = c(1993, 2022) + yrrng = c(1993, 2023) ) } \arguments{ diff --git a/man/benthicdata.Rd b/man/benthicdata.Rd index 1a0af67d..501ecf18 100644 --- a/man/benthicdata.Rd +++ b/man/benthicdata.Rd @@ -3,7 +3,7 @@ \docType{data} \name{benthicdata} \alias{benthicdata} -\title{Benthic data for the Tampa Bay Benthic Index current as of 03132024} +\title{Benthic data for the Tampa Bay Benthic Index current as of 20241212} \format{ A nested \code{\link[tibble]{tibble}} with 3 rows and 2 variables: \describe{ @@ -15,7 +15,7 @@ A nested \code{\link[tibble]{tibble}} with 3 rows and 2 variables: benthicdata } \description{ -Benthic data for the Tampa Bay Benthic Index current as of 03132024 +Benthic data for the Tampa Bay Benthic Index current as of 20241212 } \details{ Index the corresponding list element in the \code{value} column to view each dataset. For example, the stations data in the first row can be viewed as \code{benthicdata$value[[1]]}. diff --git a/man/sedimentdata.Rd b/man/sedimentdata.Rd index 7dc5ad3b..93fb2e7c 100644 --- a/man/sedimentdata.Rd +++ b/man/sedimentdata.Rd @@ -3,9 +3,9 @@ \docType{data} \name{sedimentdata} \alias{sedimentdata} -\title{Sediment data for the Tampa Bay current as of 12142023} +\title{Sediment data for the Tampa Bay current as of 20241212} \format{ -A \code{data.frame} with 216627 rows and 24 variables: +A \code{data.frame} with 226589 rows and 24 variables: \describe{ \item{ProgramId}{int} \item{ProgramName}{chr} @@ -37,7 +37,7 @@ A \code{data.frame} with 216627 rows and 24 variables: sedimentdata } \description{ -Sediment data for the Tampa Bay current as of 12142023 +Sediment data for the Tampa Bay current as of 20241212 } \examples{ \dontrun{ diff --git a/man/show_sedimentalratio.Rd b/man/show_sedimentalratio.Rd index 1ba91c28..23d901b4 100644 --- a/man/show_sedimentalratio.Rd +++ b/man/show_sedimentalratio.Rd @@ -7,7 +7,7 @@ show_sedimentalratio( sedimentdata, param, - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB"), funding_proj = "TBEP", lnsz = 1, diff --git a/man/show_sedimentave.Rd b/man/show_sedimentave.Rd index 38aed119..150c4b0e 100644 --- a/man/show_sedimentave.Rd +++ b/man/show_sedimentave.Rd @@ -7,7 +7,7 @@ show_sedimentave( sedimentdata, param, - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB"), funding_proj = "TBEP", lnsz = 1, diff --git a/man/show_sedimentmap.Rd b/man/show_sedimentmap.Rd index e94eaed2..8e439292 100644 --- a/man/show_sedimentmap.Rd +++ b/man/show_sedimentmap.Rd @@ -7,7 +7,7 @@ show_sedimentmap( sedimentdata, param, - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), funding_proj = "TBEP", weight = 1.5 ) diff --git a/man/show_sedimentpelave.Rd b/man/show_sedimentpelave.Rd index fd28ba75..784a4a75 100644 --- a/man/show_sedimentpelave.Rd +++ b/man/show_sedimentpelave.Rd @@ -6,7 +6,7 @@ \usage{ show_sedimentpelave( sedimentdata, - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB"), funding_proj = "TBEP", alph = 1, diff --git a/man/show_sedimentpelmap.Rd b/man/show_sedimentpelmap.Rd index 516c50e0..5105bdb0 100644 --- a/man/show_sedimentpelmap.Rd +++ b/man/show_sedimentpelmap.Rd @@ -6,7 +6,7 @@ \usage{ show_sedimentpelmap( sedimentdata, - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB"), funding_proj = "TBEP", weight = 1.5 diff --git a/man/show_tbbimatrix.Rd b/man/show_tbbimatrix.Rd index aeb836b0..9a9bacc7 100644 --- a/man/show_tbbimatrix.Rd +++ b/man/show_tbbimatrix.Rd @@ -7,7 +7,7 @@ show_tbbimatrix( tbbiscr, bay_segment = c("HB", "OTB", "MTB", "LTB", "TCB", "MR", "BCB", "All", "All (wt)"), - yrrng = c(1993, 2022), + yrrng = c(1993, 2023), alph = 1, txtsz = 3, family = NA, diff --git a/tests/testthat/test-anlz_sedimentave.R b/tests/testthat/test-anlz_sedimentave.R index bc190bdb..d41020dc 100644 --- a/tests/testthat/test-anlz_sedimentave.R +++ b/tests/testthat/test-anlz_sedimentave.R @@ -1,4 +1,4 @@ test_that("Checking anlz_sedimentave class", { - result <- anlz_sedimentave(sedimentdata, param = 'Arsenic', yrrng = 2022) + result <- anlz_sedimentave(sedimentdata, param = 'Arsenic', yrrng = 2023) expect_is(result, 'tbl_df') }) diff --git a/tests/testthat/test-anlz_sedimentpel.R b/tests/testthat/test-anlz_sedimentpel.R index 5372f009..90860f96 100644 --- a/tests/testthat/test-anlz_sedimentpel.R +++ b/tests/testthat/test-anlz_sedimentpel.R @@ -1,4 +1,4 @@ test_that("Checking anlz_sedimentpel class", { - result <- anlz_sedimentpel(sedimentdata, yrrng = 2022) + result <- anlz_sedimentpel(sedimentdata, yrrng = 2023) expect_is(result, 'tbl_df') }) diff --git a/tests/testthat/test-anlz_sedimentpelave.R b/tests/testthat/test-anlz_sedimentpelave.R index d86e4c23..d9413017 100644 --- a/tests/testthat/test-anlz_sedimentpelave.R +++ b/tests/testthat/test-anlz_sedimentpelave.R @@ -1,4 +1,4 @@ test_that("Checking anlz_sedimentpelave class", { - result <- anlz_sedimentpelave(sedimentdata, yrrng = 2022) + result <- anlz_sedimentpelave(sedimentdata, yrrng = 2023) expect_is(result, 'tbl_df') }) diff --git a/tests/testthat/test-show_sedimentalratio.R b/tests/testthat/test-show_sedimentalratio.R index b3e06a1c..d33fcae9 100644 --- a/tests/testthat/test-show_sedimentalratio.R +++ b/tests/testthat/test-show_sedimentalratio.R @@ -11,11 +11,11 @@ test_that("Checking show_sedimentalratio sanity checks", { test_that("Checking show_sedimentalratio class", { - result <- show_sedimentalratio(sedimentdata, param = 'Arsenic', yrrng = 2022) + result <- show_sedimentalratio(sedimentdata, param = 'Arsenic', yrrng = 2023) expect_is(result, 'ggplot') }) test_that("Checking show_sedimentalratio plotly class", { - result <- show_sedimentalratio(sedimentdata, param = 'Arsenic', yrrng = 2022, plotly = T) + result <- show_sedimentalratio(sedimentdata, param = 'Arsenic', yrrng = 2023, plotly = T) expect_is(result, 'plotly') }) diff --git a/tests/testthat/test-show_sedimentave.R b/tests/testthat/test-show_sedimentave.R index 86711aaa..c8f75810 100644 --- a/tests/testthat/test-show_sedimentave.R +++ b/tests/testthat/test-show_sedimentave.R @@ -1,9 +1,9 @@ test_that("Checking show_sedimentave class", { - result <- show_sedimentave(sedimentdata, param = 'Arsenic', yrrng = 2022) + result <- show_sedimentave(sedimentdata, param = 'Arsenic', yrrng = 2023) expect_is(result, 'ggplot') }) test_that("Checking show_sedimentave plotly class", { - result <- show_sedimentave(sedimentdata, param = 'Arsenic', yrrng = 2022, plotly = T) + result <- show_sedimentave(sedimentdata, param = 'Arsenic', yrrng = 2023, plotly = T) expect_is(result, 'plotly') }) diff --git a/tests/testthat/test-show_sedimentmap.R b/tests/testthat/test-show_sedimentmap.R index 62853a37..1ea0019a 100644 --- a/tests/testthat/test-show_sedimentmap.R +++ b/tests/testthat/test-show_sedimentmap.R @@ -1,9 +1,9 @@ test_that("Checking show_sedimentmap class", { - result <- show_sedimentmap(sedimentdata, param = 'Arsenic', yrrng = 2022) + result <- show_sedimentmap(sedimentdata, param = 'Arsenic', yrrng = 2023) expect_is(result, 'leaflet') }) test_that("Checking show_sedimentmap class, no TEL/PEL", { - result <- expect_warning(show_sedimentmap(sedimentdata, param = 'Selenium', yrrng = 2022)) + result <- expect_warning(show_sedimentmap(sedimentdata, param = 'Selenium', yrrng = 2023)) expect_is(result, 'leaflet') }) diff --git a/tests/testthat/test-show_sedimentpelave.R b/tests/testthat/test-show_sedimentpelave.R index dd77f7bd..ed2e6491 100644 --- a/tests/testthat/test-show_sedimentpelave.R +++ b/tests/testthat/test-show_sedimentpelave.R @@ -1,9 +1,9 @@ test_that("Checking show_sedimentpelave class", { - result <- show_sedimentpelave(sedimentdata, yrrng = 2022) + result <- show_sedimentpelave(sedimentdata, yrrng = 2023) expect_is(result, 'ggplot') }) test_that("Checking show_sedimentpelave plotly class", { - result <- show_sedimentpelave(sedimentdata, yrrng = 2022, plotly = T) + result <- show_sedimentpelave(sedimentdata, yrrng = 2023, plotly = T) expect_is(result, 'plotly') }) diff --git a/tests/testthat/test-show_sedimentpelmap.R b/tests/testthat/test-show_sedimentpelmap.R index 495f84d4..2f706949 100644 --- a/tests/testthat/test-show_sedimentpelmap.R +++ b/tests/testthat/test-show_sedimentpelmap.R @@ -1,4 +1,4 @@ test_that("Checking show_sedimentpelmap class", { - result <- show_sedimentpelmap(sedimentdata, yrrng = 2022) + result <- show_sedimentpelmap(sedimentdata, yrrng = 2023) expect_is(result, 'leaflet') }) diff --git a/vignettes/tbbi.Rmd b/vignettes/tbbi.Rmd index 1065381d..035ee886 100644 --- a/vignettes/tbbi.Rmd +++ b/vignettes/tbbi.Rmd @@ -145,79 +145,79 @@ sedimentdata The `show_sedimentmap()` function can be used to create maps of selected parameters relative to TEL and PEL values. Green points show concentrations below the TEL, yellow points show concentrations between the TEL and PEL, and red points show concentrations above the PEL. The applicable TEL and PEL values for the parameter are indicated in the legend. The selected stations are those that are sampled in the years within the `yrrng` argument. ```{r, out.width = '100%'} -show_sedimentmap(sedimentdata, param = 'Arsenic', yrrng = c(1993, 2022)) +show_sedimentmap(sedimentdata, param = 'Arsenic', yrrng = c(1993, 2023)) ``` A single year of data can be shown as well. ```{r, out.width = '100%'} -show_sedimentmap(sedimentdata, param = 'Arsenic', yrrng = 2022) +show_sedimentmap(sedimentdata, param = 'Arsenic', yrrng = 2023) ``` A map showing only the concentrations is returned if TEL and PEL values are not available for a parameter. ```{r, warning = FALSE, out.width = '100%'} -show_sedimentmap(sedimentdata, param = 'Selenium', yrrng = c(1993, 2022)) +show_sedimentmap(sedimentdata, param = 'Selenium', yrrng = c(1993, 2023)) ``` Maps for total contaminant values (e.g., Total DDT, Total PAH, Total PCB, Total LMW PAH, Total HMW PAH) can also be returned. Although the totals are not included in the `sedimentdata` object, they are calculated by tbeptools using the `anlz_sedimentaddtot()` function. Simply entering the name of the total parameter in the `show_sedimentmap()` function will produce the summary map. ```{r, out.width = '100%'} -show_sedimentmap(sedimentdata, param = 'Total DDT', yrrng = c(1993, 2022)) +show_sedimentmap(sedimentdata, param = 'Total DDT', yrrng = c(1993, 2023)) ``` The PEL ratio can also be used to assess relative sediment quality given the measured contaminants. The `show_sedimentpelmap()` function creates a map of average PEL ratios graded from A to F for benthic stations monitored in Tampa Bay. The PEL ratio is the contaminant concentration divided by the Potential Effects Levels (PEL) that applies to a contaminant, if available. Higher ratios and lower grades indicate sediment conditions that are likely unfavorable for invertebrates. The station average combines the PEL ratios across all contaminants measured at a station. ```{r, out.width = '100%'} -show_sedimentpelmap(sedimentdata, yrrng = c(1993, 2022)) +show_sedimentpelmap(sedimentdata, yrrng = c(1993, 2023)) ``` The average PEL ratios and grades used to create the map can also be returned as a data frame using `anlz_sedimentpel()`. ```{r} -anlz_sedimentpel(sedimentdata, yrrng = c(1993, 2022)) +anlz_sedimentpel(sedimentdata, yrrng = c(1993, 2023)) ``` Plots of bay segment averages of sediment concentrations for selected parameters can be created with `show_sedimentave()`. The plot includes appropriate lines for the TEL and PEL values, as well the grand mean across all segments. The former are omitted from the plot if unavailable for a selected parameter. ```{r, fig.height = 5, fig.width = 7} -show_sedimentave(sedimentdata, param = 'Arsenic', yrrng = c(1993, 2022)) +show_sedimentave(sedimentdata, param = 'Arsenic', yrrng = c(1993, 2023)) ``` The same plot can be returned as an interactive [plotly](https://plotly.com/r/) object using `plotly = T`. ```{r, fig.height = 5, fig.width = 7} -show_sedimentave(sedimentdata, param = 'Arsenic', yrrng = c(1993, 2022), plotly = T) +show_sedimentave(sedimentdata, param = 'Arsenic', yrrng = c(1993, 2023), plotly = T) ``` The values used in the plot can be returned with `anlz_sedimentave()`. ```{r} -anlz_sedimentave(sedimentdata, param = 'Arsenic', yrrng = c(1993, 2022)) +anlz_sedimentave(sedimentdata, param = 'Arsenic', yrrng = c(1993, 2023)) ``` As before, the total contaminant values (e.g., Total DDT, Total PAH, Total PCB, Total LMW PAH, Total HMW PAH) can also be returned even though they are not included in the `sedimentdata` object. The `anlz_sedimentaddtot()` function is used to calculate the totals within `anlz_sedimentave()`. ```{r} -anlz_sedimentave(sedimentdata, param = 'Total DDT', yrrng = c(1993, 2022)) +anlz_sedimentave(sedimentdata, param = 'Total DDT', yrrng = c(1993, 2023)) ``` A similar plot of the bay segment averages for the average PEL ratios can be created with `show_sedimentpelave()`. The colors indicate the grades for A (green) to F (red). ```{r, fig.height = 5, fig.width = 7} -show_sedimentpelave(sedimentdata, yrrng = c(1993, 2022)) +show_sedimentpelave(sedimentdata, yrrng = c(1993, 2023)) ``` The same plot can be returned as an interactive [plotly](https://plotly.com/r/) object using `plotly = T`. ```{r, fig.height = 5, fig.width = 7} -show_sedimentpelave(sedimentdata, yrrng = c(1993, 2022), plotly = T) +show_sedimentpelave(sedimentdata, yrrng = c(1993, 2023), plotly = T) ``` The values used in the plot can be returned with `anlz_sedimentpelave()`. ```{r} -anlz_sedimentpelave(sedimentdata, yrrng = c(1993, 2022)) +anlz_sedimentpelave(sedimentdata, yrrng = c(1993, 2023)) ``` The `show_sedimentalratio()` function creates a plot of a selected metal parameter against Aluminum. This plot provides information on the concentration of the parameter relative to background levels, where Aluminum is present as a common metal in the Earth's crust. An elevated ratio of a metal parameter relative to aluminum suggests it is higher than background concentrations [@Schropp90]. The linear fit of a log-log model is shown as a solid black line, with 95% prediction intervals. The TEL/PEL values, if available, are also shown as horizontal red lines.