标签:
findrun<-function(x,k){ n<-length(x) runs<-NULL for (i in 1:(n-k+1)){ if (all(x[i:(i+k-1)]==1)) runs<-c(runs,i) } return(runs) }
淡旺季(游程写法)
原文地址:http://www.cnblogs.com/xiongchang18/p/4468456.html