R/is.int.R

#' 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 )
}
drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.