R/isEmpty.R

Defines functions is.empty

Documented in is.empty

#' Is string empty
#'
#' Return TRUE or FALSE after checking if a string is empty
#'
#' @param string the string to be checked
#'
#' @return Returns TRUE or FALSE
#'
#' @examples
#' string <- "r2resume"
#' string2 <- NULL
#' is.empty(string)
#' is.empty(string2)
#' @export
#'
#'


is.empty <- function(string) {
  if (is.null(string)) {
    return(TRUE)
  }
  if ((string == "") | (is.na(string))) {
    return(TRUE)
  } else {
    return(FALSE)
  }
}

Try the r2symbols package in your browser

Any scripts or data that you put into this service are public.

r2symbols documentation built on March 31, 2023, 8:19 p.m.