#' Number Check
#'
#' Checks if an object is a number. If required, it checks if the object is an integer.
#'
#' @param x An \code{R} object.
#' @param int Logical. Should \code{x} be an integer?
#'
#' @return A logical value.
#'
#' @note This is an internal function.
#'
#' @author Michele Cianfriglia \email{michele.cianfriglia@@uniroma1.it}
#'
#' @keywords internal
number <- function(x, int = FALSE) {
if (int) {
is.numeric(x) && length(x) == 1 && !is.nan(x) && x == floor(x)
} else {
is.numeric(x) && length(x) == 1 && !is.nan(x)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.