R/notHavingNA.R

#' Names of columns which doesn't have NA
#'
#'
#' @examples
#' x <- data.frame(A = c(1:5, NA, 1:5), B = c(1:11), C = c(NA, 1:10), D=(11:21))
#' x %>% select_(.dots = notHavingNA(.) )
#' notHavingNA(x)
#' @export
notHavingNA <- function(x){
  sapply(x, function(c) !is.na(c) %>% any() ) %>%
    which %>%
    names
}
elo2zero/oddsandsods documentation built on May 16, 2019, 3:04 a.m.