Skip to content

Commit

Permalink
fix documentation for describe lists
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Jun 10, 2024
1 parent db14ad9 commit 5eb2368
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 54 deletions.
46 changes: 23 additions & 23 deletions R/anlz_hmpreport.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/read_importwq.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand Down
12 changes: 11 additions & 1 deletion R/show_ratab.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
46 changes: 23 additions & 23 deletions man/anlz_hmpreport.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/read_importwq.Rd

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

9 changes: 4 additions & 5 deletions man/show_ratab.Rd

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

0 comments on commit 5eb2368

Please sign in to comment.