Re: [R] Operating on windows of data

About this list Date view Thread view Subject view Author view Attachment view

From: Ajay Shah (ajayshah@mayin.org)
Date: Mon 22 Mar 2004 - 15:58:45 EST


Message-id: <20040322045845.GA17018@igidr.ac.in>


> I have a data set that is comprised of, for simplicity, a vector of
> numbers that I want to march across+in overlapping windows of say 10
> values each, computing a couple of values for each window. Is there
> +a vectorized way to do this, or do I truly need to resort to
> looping--I think so? Any other clever thoughts?

I'm not sure this is clever, but I use the subset capabilities of
R. See

http://www.mayin.org/ajayshah/KB/R/ols.html

3 of the examples there are related to your question, though it's
still using loops. :-)

-- 
Ajay Shah                                                   Consultant
ajayshah@mayin.org                      Department of Economic Affairs
http://www.mayin.org/ajayshah           Ministry of Finance, New Delhi

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Fri 23 Apr 2004 - 18:36:39 EST