na.if <- function(x, value = NULL, replacement, na = T) {
if (na == T) {
x[is.na(x)] <- replacement
} else if (na == F) {
x[x %in% value] <- replacement
}
x
}
null.if <- function(x, replacement = NA) {
x <- ifelse(is.null(x) | x %in% c("", " ", 'NULL', 'null'), replacement, x)
if (length(x) == 0) {
x <- replacement
}
x
}
null.if.cb <- function(x, replacement = NA) {
x <- ifelse(is.null(x) | x %in% c("", " ", "NULL", 'null', '{ND}', 'ND', '{OB}', 'OB', -999997, -999999), replacement, x)
if (length(x) == 0) {
x <- replacement
}
x
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.