R/isEmpty_function.R

Defines functions isEmpty

Documented in isEmpty

#' @title isEmpty
#' @description This function check whether data is numeric(0) and give returns an NA if this is true and the value of the data otherwise.
#' @param x Data
#' @export
#' @return NA or the data

isEmpty<-function(x){
  if(length(x)==0) {
    return(NA)
  } else {
    return(x)
  }
}

Try the ITNr package in your browser

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

ITNr documentation built on May 2, 2019, 3:27 a.m.