Skip to content
Prev 24747 / 29559 Next

Incorrect month order in zApply function

Hello,

With the current code of zApply, you should use a function that returns an ordered vector. For example:

Month <- function(x)
{
    idx <- as.numeric(format(x, '%m'))
    factor(month.name[idx],
           levels = month.name,
           ordered = TRUE)
}


x2 <- zApply(s, by = Month, mean)

Best,

Oscar.
Message-ID: <877fbxgd51.fsf@upm.es>
In-Reply-To: <1683319255.6505118.1469820024122.JavaMail.yahoo@mail.yahoo.com> (Thiago V. dos Santos via's message of "Fri, 29 Jul 2016 19:20:24 +0000 (UTC)")