Skip to content
Prev 24722 / 29559 Next

Incorrect month order in zApply function

Thanks everyone for their suggestions.

Reordering the output of zApply would be a WRONG solution, because the layers are already ordered from Jan to Dec.

It is just the NAMES that are misaligned, which can cause a bit of confusion.

I already contacted Robert about this issue and we should see a solution soon.
 Greetings,
 -- Thiago V. dos Santos

PhD student
Land and Atmospheric Science
University of Minnesota
On Friday, July 29, 2016 2:09 PM, Kay Kilpatrick <kkilpatrick at rsmas.miami.edu> wrote:
Hi

The various Apply functions always return the output in simple 
alphabetical order when the factor label is a character, regardless of 
the order of the factor in the calling argument.

Ben had a correct solution --- simply reorder the output from Zapply.

Alternatively you could use a numeric representation for the month label 
using by = as.numeric(months(x). The output would then be in increasing 
numeric order from 1 -12.

I do not believe Vijay's suggestion is proper. It does not reorder the 
output --- instead it changes the label of a given monthly mean eg. The 
value for Jan. would then be labeled as Apr.

k
On 7/28/16 10:52 PM, Thiago V. dos Santos via R-sig-Geo wrote: