Typing
library(forecast)
forecast:::is.constant
you can see its code:
function (x)
{
x <- as.numeric(x)
y <- rep(x[1], length(x))
isequal <- all.equal(c(x), y)
return(isequal == TRUE)
}
Obviously, it returns true when all values of its argument, if interpreted as numbers, are “almost equal” as determined by the utility function all.equal(whose man page is easily found). Otherwise, it returns false.
, , x NA x .