openair icon indicating copy to clipboard operation
openair copied to clipboard

[Feature Request]: Add the rollingMean function as part of the timeAverage

Open marcelooyaneder opened this issue 2 years ago • 0 comments

Hi, hope everyone is doing well.

I was using a mix of rollingMean and timeAverage function, and this make me think that the function should be inside of the timeAverage. One of the benefits of this change is the use of the type inside of rolling mean.

df8h<-data.frame()

for(station in unique(p$cod.est)){ df8h<-p%>% filter(cod.est==station)%>% rollingMean(pollutant='DatoValidado',new.name = "DatoValidado")%>% bind_rows(df8h) }

p<-df8h%>% timeAverage(avg.time = 'day',data.thresh = 75, statistic = 'max',type=c('cod.est','contaminante'))%>% timeAverage(avg.time = 'year',data.thresh = 75,statistic = 'percentile',percentile=percentile,type=c('cod.est','contaminante'))

marcelooyaneder avatar Feb 13 '23 17:02 marcelooyaneder