fixed bug: changed is.binary() to as.binary()