is.finite(x) is.infinite(x) is.nan(x) is.number(x)
is.finite is TRUE for values of x that are specific non-infinite numbers (that is, not NA and not infinite).
is.infinite is TRUE for values of x that are either plus or minus infinity.
is.nan is only TRUE for values that are "Not a Number". These are values that were created by an undefined numerical operation, such as 0/0 or Inf-Inf and they are printed as NA.
is.number is TRUE if the value is finite or infinite, i.e., is neither missing (NA) nor not-a-number (NaN).
# a non-zero number divided by zero creates infinity # zero over zero creates a NaN weird.values <- c(1/0, -20.9/0, 0/0, NA)is.infinite(weird.values)
is.nan(weird.values) is.na(weird.values)