#' Checks which elements of a vector are integers.
#'
#' This differs from is.integer which only checks the class of the entire
#' vector.
#'
#' @param x a vector. usually this will be a numeric vector, but can also be a
#' character
#' @return a logical vector, same length as x, with TRUE if each element is an
#' integer
#' @author Mark Cowley, 2009-11-30
#' @export
is.int <- function(x) {
suppressWarnings( as.integer(x) == x )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.