please see the code and the result. I assume that you can get a vector as x
> x<-55:66
> y<-numeric()
> for (i in 1:length(x)) { if (x[i]<60) y[i]=0 else y[i]=1}
> fail<-length(x)-sum(y); print(x);print(y);print(fail)
[1] 55 56 57 58 59 60 61 62 63 64 65 66
[1] 0 0 0 0 0 1 1 1 1 1 1 1
[1] 5
>