From 5eb23685204c9d3ac0ec894cdf150c47a88ada44 Mon Sep 17 00:00:00 2001 From: fawda123 Date: Mon, 10 Jun 2024 10:17:42 -0400 Subject: [PATCH] fix documentation for describe lists --- R/anlz_hmpreport.R | 46 +++++++++++++++++++++---------------------- R/read_importwq.R | 2 +- R/show_ratab.R | 12 ++++++++++- man/anlz_hmpreport.Rd | 46 +++++++++++++++++++++---------------------- man/read_importwq.Rd | 2 +- man/show_ratab.Rd | 9 ++++----- 6 files changed, 63 insertions(+), 54 deletions(-) diff --git a/R/anlz_hmpreport.R b/R/anlz_hmpreport.R index 6beee65e..446e252f 100644 --- a/R/anlz_hmpreport.R +++ b/R/anlz_hmpreport.R @@ -14,33 +14,33 @@ #' #' Columns in the output are as follows: #' -#' \itemize{ -#' \item{year: }{Year of the assessment} -#' \item{metric :}{Habitat type assessed} -#' \item{Acres: }{Coverage estimate for the year} -#' \item{lacres: }{Coverage estimate for the previous set of available data} -#' \item{lyr: }{Year for the previous set of available data} -#' \item{category: }{Strata for the habitat type} -#' \item{Target: }{2030 target for the habitat type from the Habitat Master Plan} -#' \item{Goal: }{2050 goal for the habitat type from the Habitat Master Plan} -#' \item{acresdiff: }{Difference in acres for the current year and the previous set of available data} -#' \item{yeardiff: }{Difference in years for the current year and the previous set of available data} -#' \item{changerate: }{Acreage change per year for the current year relative to the previous set of available data} -#' \item{targetrate: }{Annual rate required to achieve the 2030 target} -#' \item{goalrate: }{Annual rate required to achieve the 2050 goal} -#' \item{targetprop: }{Proportion of target met for the current year} -#' \item{goalprop: }{Proportion of goal met for the current year} -#' \item{targeteval: }{A number indicating target status of the current year for the report card} -#' \item{goaleval: }{A number indicating goal status of the current year for the report card} +#' \describe{ +#' \item{year}{Year of the assessment} +#' \item{metric}{Habitat type assessed} +#' \item{Acres}{Coverage estimate for the year} +#' \item{lacres}{Coverage estimate for the previous set of available data} +#' \item{lyr}{Year for the previous set of available data} +#' \item{category}{Strata for the habitat type} +#' \item{Target}{2030 target for the habitat type from the Habitat Master Plan} +#' \item{Goal}{2050 goal for the habitat type from the Habitat Master Plan} +#' \item{acresdiff}{Difference in acres for the current year and the previous set of available data} +#' \item{yeardiff}{Difference in years for the current year and the previous set of available data} +#' \item{changerate}{Acreage change per year for the current year relative to the previous set of available data} +#' \item{targetrate}{Annual rate required to achieve the 2030 target} +#' \item{goalrate}{Annual rate required to achieve the 2050 goal} +#' \item{targetprop}{Proportion of target met for the current year} +#' \item{goalprop}{Proportion of goal met for the current year} +#' \item{targeteval}{A number indicating target status of the current year for the report card} +#' \item{goaleval}{A number indicating goal status of the current year for the report card} #' } #' #' The numbers in \code{targeteval} and \code{goaleval} are one of four values as -1, 0, 0.5, and 1. These numbers define the status for the assessment year: #' -#' \itemize{ -#' \item{-1: }{target or goal not met, trending below} -#' \item{0: }{target or goal met, trending below} -#' \item{0.5: }{target or goal not met, trending above} -#' \item{1: }{target or goal met, trending above} +#' \describe{ +#' \item{-1}{target or goal not met, trending below} +#' \item{0}{target or goal met, trending below} +#' \item{0.5}{target or goal not met, trending above} +#' \item{1}{target or goal met, trending above} #' } #' #' @export diff --git a/R/read_importwq.R b/R/read_importwq.R index 872e1427..3108421f 100644 --- a/R/read_importwq.R +++ b/R/read_importwq.R @@ -7,7 +7,7 @@ #' #' @details Loads the "RWMDataSpreadsheet" worksheet from the file located at \code{xlsx}. The file is downloaded from \url{https://epcbocc.sharepoint.com/:x:/s/Share/EYXZ5t16UlFGk1rzIU91VogBa8U37lh8z_Hftf2KJISSHg?e=8r1SUL&download=1}. The files can be viewed at \url{https://epcbocc.sharepoint.com/:f:/s/Share/EiypSSYdsEFCi84Sv_6-t7kBUYaXiIqN0B1n2w57Z_V3kQ?e=NdZQcU}. #' -#' Water quality parameters returned by default are total nitrogen (\code{tn}), Secchi depth (\code{sd}), chlorophyll-a (\code{chla}), salinity (top, mid, and bottom depths, \code{Sal_} prefix), water temperature (top, mid, and bottom depths, {\code{Temp_Water_} prefix}), turbidity (\code{Turbidity_JTU-NTU}), and water color (\code{Color_345_F45}). Additional qualifier columns for each that include the \code{_Q} suffix are also returned, excluding salinity and water temperature. All other water quality parameters and qualifiers can be returned by setting \code{all = T}. +#' Water quality parameters returned by default are total nitrogen (\code{tn}), Secchi depth (\code{sd}), chlorophyll-a (\code{chla}), salinity (top, mid, and bottom depths, \code{Sal_} prefix), water temperature (top, mid, and bottom depths, \code{Temp_Water_} prefix), turbidity (\code{Turbidity_JTU-NTU}), and water color (\code{Color_345_F45}). Additional qualifier columns for each that include the \code{_Q} suffix are also returned, excluding salinity and water temperature. All other water quality parameters and qualifiers can be returned by setting \code{all = T}. #' #' @export #' diff --git a/R/show_ratab.R b/R/show_ratab.R index f606aee5..0d219893 100644 --- a/R/show_ratab.R +++ b/R/show_ratab.R @@ -23,11 +23,21 @@ #' #' @examples #' show_ratab(epcdata, yrsel = 2023, bay_segment = 'OTB') -show_ratab <- function(epcdata, yrsel, bay_segment = c('OTB', 'HB', 'MTB', 'LTB', 'RALTB'), partialyr = F, outtxt1 = 'All years below threshold so far, not necessary for NMC Actions 2-5', outtxt2 = "All years met threshold, not necessary for NMC Actions 3-5", outtxt3 = "Not necessary due to observed water quality and seagrass conditions in the bay segment", outtxt45 = "Not necessary when chlorophyll-*a* threshold met", txtsz = 13, width = NULL){ +show_ratab <- function(epcdata, yrsel, bay_segment = c('OTB', 'HB', 'MTB', 'LTB', 'RALTB'), partialyr = F, outtxt1 = NULL, outtxt2 = NULL, outtxt3 = NULL, outtxt45 = NULL, txtsz = 13, width = NULL){ if(!requireNamespace('ftExtra', quietly = TRUE)) stop("Package \"ftExtra\" needed for this function to work. Please install it.", call. = FALSE) + # defaults for text + if(is.null(outtxt1)) + outtxt1 <- 'All years below threshold so far, not necessary for NMC Actions 2-5' + if(is.null(outtxt2)) + outtxt2 <- "All years met threshold, not necessary for NMC Actions 3-5" + if(is.null(outtxt3)) + outtxt3 <- "Not necessary due to observed water quality and seagrass conditions in the bay segment" + if(is.null(outtxt45)) + outtxt45 <- "Not necessary when chlorophyll-*a* threshold met" + # segment bay_segment <- match.arg(bay_segment) diff --git a/man/anlz_hmpreport.Rd b/man/anlz_hmpreport.Rd index 3387407d..c38318eb 100644 --- a/man/anlz_hmpreport.Rd +++ b/man/anlz_hmpreport.Rd @@ -24,33 +24,33 @@ The relevant output columns are \code{targeteval} and \code{goaleval} that indic Columns in the output are as follows: -\itemize{ - \item{year: }{Year of the assessment} - \item{metric :}{Habitat type assessed} - \item{Acres: }{Coverage estimate for the year} - \item{lacres: }{Coverage estimate for the previous set of available data} - \item{lyr: }{Year for the previous set of available data} - \item{category: }{Strata for the habitat type} - \item{Target: }{2030 target for the habitat type from the Habitat Master Plan} - \item{Goal: }{2050 goal for the habitat type from the Habitat Master Plan} - \item{acresdiff: }{Difference in acres for the current year and the previous set of available data} - \item{yeardiff: }{Difference in years for the current year and the previous set of available data} - \item{changerate: }{Acreage change per year for the current year relative to the previous set of available data} - \item{targetrate: }{Annual rate required to achieve the 2030 target} - \item{goalrate: }{Annual rate required to achieve the 2050 goal} - \item{targetprop: }{Proportion of target met for the current year} - \item{goalprop: }{Proportion of goal met for the current year} - \item{targeteval: }{A number indicating target status of the current year for the report card} - \item{goaleval: }{A number indicating goal status of the current year for the report card} +\describe{ + \item{year}{Year of the assessment} + \item{metric}{Habitat type assessed} + \item{Acres}{Coverage estimate for the year} + \item{lacres}{Coverage estimate for the previous set of available data} + \item{lyr}{Year for the previous set of available data} + \item{category}{Strata for the habitat type} + \item{Target}{2030 target for the habitat type from the Habitat Master Plan} + \item{Goal}{2050 goal for the habitat type from the Habitat Master Plan} + \item{acresdiff}{Difference in acres for the current year and the previous set of available data} + \item{yeardiff}{Difference in years for the current year and the previous set of available data} + \item{changerate}{Acreage change per year for the current year relative to the previous set of available data} + \item{targetrate}{Annual rate required to achieve the 2030 target} + \item{goalrate}{Annual rate required to achieve the 2050 goal} + \item{targetprop}{Proportion of target met for the current year} + \item{goalprop}{Proportion of goal met for the current year} + \item{targeteval}{A number indicating target status of the current year for the report card} + \item{goaleval}{A number indicating goal status of the current year for the report card} } The numbers in \code{targeteval} and \code{goaleval} are one of four values as -1, 0, 0.5, and 1. These numbers define the status for the assessment year: -\itemize{ - \item{-1: }{target or goal not met, trending below} - \item{0: }{target or goal met, trending below} - \item{0.5: }{target or goal not met, trending above} - \item{1: }{target or goal met, trending above} +\describe{ + \item{-1}{target or goal not met, trending below} + \item{0}{target or goal met, trending below} + \item{0.5}{target or goal not met, trending above} + \item{1}{target or goal met, trending above} } } \examples{ diff --git a/man/read_importwq.Rd b/man/read_importwq.Rd index 1b378a30..ed59dc1e 100644 --- a/man/read_importwq.Rd +++ b/man/read_importwq.Rd @@ -24,7 +24,7 @@ Load local water quality file \details{ Loads the "RWMDataSpreadsheet" worksheet from the file located at \code{xlsx}. The file is downloaded from \url{https://epcbocc.sharepoint.com/:x:/s/Share/EYXZ5t16UlFGk1rzIU91VogBa8U37lh8z_Hftf2KJISSHg?e=8r1SUL&download=1}. The files can be viewed at \url{https://epcbocc.sharepoint.com/:f:/s/Share/EiypSSYdsEFCi84Sv_6-t7kBUYaXiIqN0B1n2w57Z_V3kQ?e=NdZQcU}. -Water quality parameters returned by default are total nitrogen (\code{tn}), Secchi depth (\code{sd}), chlorophyll-a (\code{chla}), salinity (top, mid, and bottom depths, \code{Sal_} prefix), water temperature (top, mid, and bottom depths, {\code{Temp_Water_} prefix}), turbidity (\code{Turbidity_JTU-NTU}), and water color (\code{Color_345_F45}). Additional qualifier columns for each that include the \code{_Q} suffix are also returned, excluding salinity and water temperature. All other water quality parameters and qualifiers can be returned by setting \code{all = T}. +Water quality parameters returned by default are total nitrogen (\code{tn}), Secchi depth (\code{sd}), chlorophyll-a (\code{chla}), salinity (top, mid, and bottom depths, \code{Sal_} prefix), water temperature (top, mid, and bottom depths, \code{Temp_Water_} prefix), turbidity (\code{Turbidity_JTU-NTU}), and water color (\code{Color_345_F45}). Additional qualifier columns for each that include the \code{_Q} suffix are also returned, excluding salinity and water temperature. All other water quality parameters and qualifiers can be returned by setting \code{all = T}. } \examples{ \dontrun{ diff --git a/man/show_ratab.Rd b/man/show_ratab.Rd index 5af5a88f..0c4b4628 100644 --- a/man/show_ratab.Rd +++ b/man/show_ratab.Rd @@ -9,11 +9,10 @@ show_ratab( yrsel, bay_segment = c("OTB", "HB", "MTB", "LTB", "RALTB"), partialyr = F, - outtxt1 = "All years below threshold so far, not necessary for NMC Actions 2-5", - outtxt2 = "All years met threshold, not necessary for NMC Actions 3-5", - outtxt3 = - "Not necessary due to observed water quality and seagrass conditions in the bay segment", - outtxt45 = "Not necessary when chlorophyll-*a* threshold met", + outtxt1 = NULL, + outtxt2 = NULL, + outtxt3 = NULL, + outtxt45 = NULL, txtsz = 13, width = NULL )