Hi Sandy,
Why don't you usw runmean() of the caTools package??
In the see also section of the help for runmean() there are various other
possibilities given.
Good Luck
Gerald
——
3rd Law of Computing:
Anything that can go wr
fortune: Segmentation violation -- Core dumped
Am 06.11.2010
On Nov 6, 2010, at 3:00 PM, Gerald Jurasinski wrote:
Hi Sandy,
Why don't you usw runmean() of the caTools package??
In the see also section of the help for runmean() there are various
other possibilities given.
Also rollmean or rollapply in package zoo. Eg:
library(zoo)
Please helpI'm trying to calculate a 5-point rolling average and I keep
getting a length issue.
My script is
ma5-function (x){
y-numeric(length(x-2)
for(i in 2(length(x)-1)){
y[i]]-(x[i-3]+x[i-2]+x[i-1]+x[i]+x[i+1]))/5
}
Y}
I keep getting a replacement has length zero
Ive tried
On Nov 5, 2010, at 12:03 PM, Sandy Zelka wrote:
Please helpI'm trying to calculate a 5-point rolling average and
I keep getting a length issue.
My script is
Not a SIG-Mac issue.
ma5-function (x){
y-numeric(length(x-2)
for(i in 2(length(x)-1)){
You seem to missing an operator