Hi, I am new to R and i am looking for a way to extract a subset from a vector. I have a vector of number oscillating around zero (a decreasing autocorrelation function) and i would like to extract only the first positive part of the function (from zero lag to the lag where the function inverts its sign for the first time). I have tried
subset(myvector,myvector>0) but this obviously extract all the positive intervals not only the first one. Is there a logical statement i can use in subset? I prefer not to use an if statement that would probably slow down the code. Thanks a lot, Luca ********************************************************* dr. Luca Mortarini [EMAIL PROTECTED] Università del Piemonte Orientale Dipartimento di Scienze e Tecnologie Avanzate ______________________________________________ R-help@r-project.org 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.