Skip to content
Prev 24720 / 29559 Next

Incorrect month order in zApply function

Maybe like this?

R> m <- function(x) ordered(months(x),labels=month.name)
R> x1 <- zApply(s, by=m, mean, name=month.abb[])
R> names(x1) # Appears to have natural ordering
R> all(x[] == x1[]) # TRUE

I'm not sure how using factors will impact other aspects of your project.
HTH,
Vijay.

On Thu, Jul 28, 2016 at 10:52 PM, Thiago V. dos Santos via R-sig-Geo <
r-sig-geo at r-project.org> wrote: