R/f_helpers.R

Defines functions countUnique sMissing_num sMissing_str

#Various helper functions

.isMissing_str <- function(x) {
  #Determines if any elements in a string vector are missing.
  any(is.na(x) | x == "")
}

.isMissing_num <- function(x) {
  #Determines if any elements in a numeric vector are missing.
  any(is.na(x) | is.nan(x) | is.infinite(x))
}

.countUnique <- function(x) {
  #Counts the number of unique elements in a vector.
  length(unique(x))
}

Try the openEBGM package in your browser

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

openEBGM documentation built on Aug. 17, 2018, 1:05 a.m.