#'Evaluate if a vector is empty
#'
#'\code{not_all_na} takes a vector and checks whether at least one element
#' is not an \code{NA}. This is particularly useful when selecting non_empty
#' columns of a data frame or tibble.
#'
#'@export
#'
#'@param x A vector to be evaluated.
#'@return A logical value (\code{TRUE} or \code{FALSE}) that answers the question
#' "is any element of the vector not an NA.
#'@examples
#'x1 <- c(0,1,NA,5)
#'not_all_na(x1)
#'x2 <- rep(NA, 5)
#'not_all_na(x2)
not_all_na <- function(x){
any(!is.na(x))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.