From ccf767ddbb1e2c9c2f644894635d8b30a87789a3 Mon Sep 17 00:00:00 2001 From: Sebastian Henz <sebastian.henz@ufz.de> Date: Tue, 28 Jul 2020 16:06:51 +0200 Subject: [PATCH] Add return values to some documentation According to CRAN rules all exported functions must specify a return value. --- DESCRIPTION | 4 ++-- R/plot_ecxsys.R | 2 ++ R/plot_stress.R | 1 + R/plot_survival.R | 1 + R/stress_survival_conversion.R | 10 +++++++--- man/Stressconversion.Rd | 11 ++++++++--- man/plot_ecxsys.Rd | 3 +++ 7 files changed, 24 insertions(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2b2edea..6cd7cfb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: stressaddition Type: Package Title: Modelling Tri-Phasic Concentration-Response Relationships -Version: 3.0.0 -Date: 2020-07-06 +Version: 3.0.1 +Date: 2020-07-28 Authors@R: c(person("Sebastian", "Henz", role = c("aut", "cre"), diff --git a/R/plot_ecxsys.R b/R/plot_ecxsys.R index 6d1ec9e..15658e9 100644 --- a/R/plot_ecxsys.R +++ b/R/plot_ecxsys.R @@ -40,6 +40,8 @@ #' the number of elements shown. #' @param xlab,ylab,main Axis labels and title. #' +#' @return None +#' #' @examples model <- ecxsys( #' concentration = c(0, 0.05, 0.5, 5, 30), #' hormesis_concentration = 0.5, diff --git a/R/plot_stress.R b/R/plot_stress.R index 1d702a9..52cce5b 100644 --- a/R/plot_stress.R +++ b/R/plot_stress.R @@ -194,4 +194,5 @@ plot_stress <- function(model, ) } } + NULL # suppress all possible return values } diff --git a/R/plot_survival.R b/R/plot_survival.R index 7963504..39a7613 100644 --- a/R/plot_survival.R +++ b/R/plot_survival.R @@ -175,4 +175,5 @@ plot_survival <- function(model, ) } } + NULL # suppress all possible return values } diff --git a/R/stress_survival_conversion.R b/R/stress_survival_conversion.R index 50e614e..3a81e32 100644 --- a/R/stress_survival_conversion.R +++ b/R/stress_survival_conversion.R @@ -24,9 +24,7 @@ #' #' These are simple wrappers around the beta distribution function #' \code{\link[stats:Beta]{pbeta}} and the beta quantile function -#' \code{\link[stats:Beta]{qbeta}}. \code{stress_to_survival} returns \code{1 - -#' pbeta(stress, p, q)}. \code{survival_to_stress} first clamps the survival to -#' the interval [0, 1] and then returns \code{qbeta(1 - survival, p, q)}. +#' \code{\link[stats:Beta]{qbeta}}. #' #' @name Stressconversion #' @@ -37,6 +35,12 @@ #' @param p,q The shape parameters of the \code{\link[stats:Beta]{beta}} #' distribution. Default is 3.2. #' +#' @return \code{stress_to_survival} returns a vector the same length as +#' \code{stress} giving the survival caused by each amount of stress. +#' +#' \code{survival_to_stress} returns a vector the same length as +#' \code{survival} containing the stress values associated with each survival. +#' #' @examples #' stress <- 0.3 #' survival <- stress_to_survival(stress) diff --git a/man/Stressconversion.Rd b/man/Stressconversion.Rd index 6ffa537..df18376 100644 --- a/man/Stressconversion.Rd +++ b/man/Stressconversion.Rd @@ -20,6 +20,13 @@ distribution. Default is 3.2.} \item{stress}{One or more stress values to convert to survival.} } +\value{ +\code{stress_to_survival} returns a vector the same length as + \code{stress} giving the survival caused by each amount of stress. + + \code{survival_to_stress} returns a vector the same length as + \code{survival} containing the stress values associated with each survival. +} \description{ Functions to convert survival to general stress or vice versa using the beta distribution. @@ -27,9 +34,7 @@ distribution. \details{ These are simple wrappers around the beta distribution function \code{\link[stats:Beta]{pbeta}} and the beta quantile function -\code{\link[stats:Beta]{qbeta}}. \code{stress_to_survival} returns \code{1 - -pbeta(stress, p, q)}. \code{survival_to_stress} first clamps the survival to -the interval [0, 1] and then returns \code{qbeta(1 - survival, p, q)}. +\code{\link[stats:Beta]{qbeta}}. } \examples{ stress <- 0.3 diff --git a/man/plot_ecxsys.Rd b/man/plot_ecxsys.Rd index d5c09b0..ae35a65 100644 --- a/man/plot_ecxsys.Rd +++ b/man/plot_ecxsys.Rd @@ -42,6 +42,9 @@ the number of elements shown.} \item{xlab, ylab, main}{Axis labels and title.} } +\value{ +None +} \description{ Plot the observed and modeled survivals and stresses. } -- GitLab