ropensci / tidyhydat

An R package to import Water Survey of Canada hydrometric data and make it tidy
https://docs.ropensci.org/tidyhydat
Apache License 2.0
70 stars 19 forks source link

reshape using pivot_longer #152

Closed boshek closed 3 years ago

boshek commented 3 years ago

As interesting as this, benchmarking demonstrates that there are no performance gains over the in-memory solution:

R> microbenchmark::microbenchmark(
   hy_daily_flows(prov_terr_state_loc = "BC", start_date = as.Date("2018-01-01"), end_date = as.Date("2018-12-31")), times = 5
 )
Unit: seconds
                                                                                                                  expr
 hy_daily_flows(prov_terr_state_loc = "BC", start_date = as.Date("2018-01-01"),      end_date = as.Date("2018-12-31"))
      min       lq     mean  median       uq      max neval
 2.955362 2.960431 3.034962 2.97163 3.021069 3.266315     5
NOTE: .Random.seed changed
R> 
R> 
R> microbenchmark::microbenchmark(
   tidyhydat::hy_daily_flows(prov_terr_state_loc = "BC", start_date = as.Date("2018-01-01"), end_date = as.Date("2018-12-31")), times = 5
 )
Unit: seconds
                                                                                                                             expr
 tidyhydat::hy_daily_flows(prov_terr_state_loc = "BC", start_date = as.Date("2018-01-01"),      end_date = as.Date("2018-12-31"))
      min       lq     mean   median       uq      max neval
 2.798188 2.821361 2.870246 2.891894 2.897072 2.942717     5
NOTE: .Random.seed changed