runapp-aus / strayr

A catalogue of ready-to-use ABS coding structures. Package documentation can be found here: https://runapp-aus.github.io/strayr/
45 stars 15 forks source link

+aus_seasons() #88

Closed carlosyanez closed 1 year ago

carlosyanez commented 1 year ago

Hi !

I would like to suggest a new , very simple helper function: aus_seasons(). This function takes a vector with dates and returns a vector with the corresponding season names - following the Australian seasons definitions (i.e. month aligned rather than solstice-equinox).

The package comes with both 4 seasons and Top End, "tropical" wet/dry seasons.

sample_dates <- c("2022-01-01","2018-10-04","2016-07-20")
# temperate seasons
aus_seasons(sample_dates,"temperate")
#> [1] "Summer" "Spring" "Winter"
# tropical seasons
aus_seasons(sample_dates,"tropical")
#> [1] "Wet Season" "Dry Season" "Dry Season"

Kind Regards, Carlos

MattCowgill commented 1 year ago

Looks good to me.

@wfmackey / @daviddiviny / @mrjoh3 / anyone else: any thoughts?

MattCowgill commented 1 year ago

Thanks for contributing @carlosyanez !

wfmackey commented 1 year ago

Nice work, thanks for contributing @carlosyanez!