Open a connection to the HYDAT database
hy_src(hydat_path = NULL) hy_src_disconnect(src)
hydat_path |
The path to the hydat database or NULL to use the default location used by download_hydat. It is also possible to pass in an existing src_sqlite such that the database only needs to be opened once per user-level call. |
src |
A src_sqlite as returned by |
A dplyr src_sqlite
## Not run: library(dplyr) # src is a src_sqlite src <- hy_src(hydat_path = hy_test_db()) src_tbls(src) # to get a table, use dplyr::tbl() tbl(src, "STATIONS") # one you're sure the results are what you want # get a data.frame using collect() tbl(src, "STATIONS") %>% filter(PROV_TERR_STATE_LOC == "BC") %>% collect() # close the connection to the database hy_src_disconnect(src) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.