Recent content by UserR

  1. U

    Finding Runs for Consecutive Ones

    Hi, I am new to programming. Sorry for the basic question. I came across this code to find runs for consecutive ones for the vector (1,0,0,1,1,1,0,1,1). The code for this is findruns1<-function(x,k) { n<-length(x) runs<-vector(length=n) count<-0 for(i in 1:(n-k+1)){...