#' remove different kinds of missing values from a vector
#'
#' namely NULL, NA, "" and any non-finite values
hasdata<-function (x, return.index = F) {
index <- which(!is.null(x) & !is.na(x) & x != "" & !is.infinite(x))
value <- x[which(!is.null(x) & !is.na(x) & x != "" & !is.infinite(x))]
if (return.index) {
return(index)
}
return(value)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.