Hi all..RCounters!
I´m working with standarized time series, and i need make a counter of
consecutives positves numbers to make a cumulative experimental funtion. I
have x: the time series (0,1) and y: my counter, i have this for step. What is
wrong?.. any can help me please!
x<-rbinom(15,1,.3)
y<-NULL;s<-0
for (i in 1: length (x))
{if (x[i]>0)
{s<-s+x[i]
s=0}
else
y<-c(y,s)}
y
x
Thk u all!
José Bustos
---------------------------------
[[alternative HTML version deleted]]
______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.