powered by
is.binary(x)
w<-sample(c(1,2),size=10,replace=TRUE) is.binary(w) x<-factor(w) is.binary(x) y<-sample(c(1,2,3),size=10,replace=TRUE) is.binary(y) z<-factor(y) is.binary(z)
Run the code above in your browser using DataLab