R/is_positive.r

Defines functions is_positive

Documented in is_positive

#' Conditional check for a positive value
#'
#' @description Return TRUE if the value is positive.
#'
#' @eval arg_vector("x","numeric")
#'
#' @return A boolean vector with the return from the condition check.
#' @export
#'
#' @examples
#'
#' is_positive(4)
#'
#' is_positive(-4)
#'

is_positive <- function(x){

  stopifnot(is.numeric(x))

  dplyr::if_else(
    condition = x > 0,
    true =  TRUE,
    false =  FALSE
    )

}
vbfelix/relper documentation built on May 10, 2024, 10:50 p.m.