Say, I have a vector y, and I want to check if each element in y is integer or not, and if not, stop with an error message. I tried is.integer(y), but it does not work.
checking the following helps with a crisp if condition which we can use on scripting.
sff <- 5 if(!(is.integer(sff) == is.character(sff))){ sff } else { "hello" }
gives
hello
sff <- 'a' gives 'a' as the result.
sff <- 'a'
'a'