R/golem_utils_server.R

Defines functions is_pas_zero is_not_empty

#' Inverted versions of in, is.null and is.na
#' 
#' @noRd
#' 
#' @examples
#' 1 %not_in% 1:10
#' not_null(NULL)
`%not_in%` <- Negate(`%in%`)

not_null <- Negate(is.null)

not_na <- Negate(is.na)

is_not_empty <- function(x) all(!is.na(x) & x != "")

is_pas_zero  <- function(x) {
  if(is.numeric(x)) { 
    all(x != 0)
  } else {
      TRUE
    }
}

#' Typing reactiveValues is too long
#' 
#' @inheritParams reactiveValues
#' @inheritParams reactiveValuesToList
#' 
#' @noRd
rv <- shiny::reactiveValues
rvtl <- shiny::reactiveValuesToList
jengelaere/enr.reseaux documentation built on Dec. 20, 2021, 11:01 p.m.