use is.factor etc
prefer stopifnot