ropensci-archive / bomrang

:warning: ARCHIVED :warning: Australian government Bureau of Meteorology (BOM) data client for R
Other
109 stars 26 forks source link

Resolve group_by issues (#105) #106

Closed jonocarroll closed 4 years ago

jonocarroll commented 4 years ago

As far as I can tell this resolves the group_by issues of #105. The bind_rows issue appears to be resolved by either this or by upgrading to the development version of dplyr (correct me if I'm wrong).

Hobart %>% 
  mutate(day = as.Date(local_date_time_full)) %>%
  group_by(day) %>% 
  summarise(daily_temp = mean(air_temp))
#> # A tibble: 4 x 2
#>   day        daily_temp
#>   <date>          <dbl>
#> 1 2019-11-17       12.4
#> 2 2019-11-18       15.7
#> 3 2019-11-19       13.0
#> 4 2019-11-20       20.2

Groups are also once again displayed in a grouped object

Hobart %>% 
  mutate(day = as.Date(local_date_time_full)) %>%
  group_by(day) 
#>   ---- Australian Bureau of Meteorology (BOM) Data Resource ----
#>   (Original Request Parameters)
#>   Station:       HOBART (ELLERSLIE ROAD) [094029] 
#>   Location:      lat: -42.8897, lon: 147.3278
#>   Measurement / Origin:  All / Current
#>   Timespan:      1882 -- 2019 [137 years]
#>   Groups:        day [4]
#>   ---------------------------------------------------------------