On Thu, Oct 21, 2010 at 5:30 PM, Philippe Hensel <philippe.hen...@noaa.gov> wrote: > I am trying to create basic descriptive statistics for a spatial dataset > using moving windows of variable sizes. > > I found the filter(dataset, rep(1/a,1)) very useful for obtaining averages > for a given moving window size "a" > (a is the window size within a column of data in a matrix - the filter is > applied to all columns automatically) > > I could not find anything analogous for calculating variances over a moving > window. Is there one available? > Otherwise, I'm slowly cranking away on making my own, but it's quite > tedious! >
rollapply in the zoo package can take an arbitrary R function. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com ______________________________________________ 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.