I was wondering if there is a way to calculate the average emission exception using the dplyr package in R? I tried to do something similar, but did not work:
library(dplyr)
w = rep("months", 4)
value = c(1, 10, 12, 9)
df = data.frame(w, value)
output = df %>% group_by(w) %>% summarise(m = mean(value, na.rm = T, outlier = T))
So, in the above example, the output should be 10.333 (average value of 10, 12 and 9) instead of 8 (average value of 1, 10, 12, 9)
Thank!
source
share