search for: vectortotest

Displaying 1 result from an estimated 1 matches for "vectortotest".

2011 Mar 23
3
Compare three or more values?
Is there a less cryptic way to compare three or more values? allTheSame<-c("red","red","red","red") notAllTheSame<-c(132,132,132,999) all.identical <- function(vectorToTest){ cIdentical=sum(vectorToTest %in% vectorToTest[1]) return(cIdentical==length(vectorToTest)) } all.identical(allTheSame) all.identical(notAllTheSame) Thanks in advance, Holly