diff --git a/DESCRIPTION b/DESCRIPTION index 2e5e4a9..6ff8f7f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: efun Title: Miscellaneous Functions by E -Version: 0.3.3 +Version: 0.3.4 Authors@R: person(given = "Eduardo", family = "Alfonso-Sierra", diff --git a/R/assert.R b/R/assert.R index d33c683..5339728 100644 --- a/R/assert.R +++ b/R/assert.R @@ -21,7 +21,9 @@ #' @param .data A data frame containing the variables used in the conditions. #' @param ... One or more expressions to be evaluated within the data frame. #' @param msg A character vector specifying the message to include in the error -#' message if the assertion fails. +#' message if the assertion fails. +#' @param na.rm passed to `all()`: logical. If true NA values are removed +#' before the result is computed. #' #' @return The data frame `.data` if all conditions are met. Otherwise, an error #' is thrown. diff --git a/man/assert.Rd b/man/assert.Rd index a86f6b0..ddc6bb3 100644 --- a/man/assert.Rd +++ b/man/assert.Rd @@ -4,7 +4,7 @@ \alias{assert} \title{Assert a condition within a data frame} \usage{ -assert(.data, ..., msg = "Assertion does not hold") +assert(.data, ..., msg = "Assertion does not hold", na.rm = TRUE) } \arguments{ \item{.data}{A data frame containing the variables used in the conditions.} @@ -13,6 +13,9 @@ assert(.data, ..., msg = "Assertion does not hold") \item{msg}{A character vector specifying the message to include in the error message if the assertion fails.} + +\item{na.rm}{passed to \code{all()}: logical. If true NA values are removed +before the result is computed.} } \value{ The data frame \code{.data} if all conditions are met. Otherwise, an error