Displaying 1 result from an estimated 1 matches for "number_of_years_to_average".
2008 Sep 23
0
additional parameters in function called by tapply
...f the average of several years of the sums
for step a I use tapply with the following call
indices <- (list(year,spatial2,parameter)
resultspatial <- tapply(value,indices,sum)
for step b I use apply with the result of a and a function block_average
block_average <- funcition(value,year,number_of_years_to_average) with the parameters value and years as vectors and number_of_years as integer.
When I'm trying to skip the spatial aggregation, i.e. just do the block_averaging over years, I have the problem (AFIU the man page), that I can't provide the years vector as parameter to the function block_ave...