This function can be used to download a Station Inventory CSV file from Environment and Climate Change Canada. This is only necessary if the station you're interested was only recently added. The 'stations' data set included in this package contains station data downloaded when the package was last compiled. This function may take a few minutes to run.
stations_dl( url = NULL, normals_years = "1981-2010", skip = NULL, verbose = FALSE, quiet = FALSE )
url | DEPRECATED. To set a different url use |
---|---|
normals_years | Character. The year range for which you want climate normals. Default "1981-2010". |
skip | Numeric. Number of lines to skip at the beginning of the csv. If NULL, automatically derived. |
verbose | Logical. Include progress messages |
quiet | Logical. Suppress all messages (including messages regarding missing data, etc.) |
A tibble containing station names, station ID codes, dates of operation, as well as whether or not there are data on climate normals.
The stations list is downloaded from the url stored in the option
weathercan.urls.stations
. To change this location use
options(weathercan.urls.stations = "your_new_url")
.
The list of which stations have climate normals is downloaded from the url
stored in the option weathercan.urls.normals
. To change this location use
options(weathercan.urls.normals = "your_new_url")
.
# \donttest{ # Update stations data frame if(requireNamespace("lutz") && requireNamespace("sf")) { s <- stations_dl() # Use new data frame to search for stations stations_search("Winnipeg", stn = s) }#>#>#>#> #>#> # A tibble: 85 x 14 #> prov station_name station_id climate_id WMO_id TC_id lat lon elev tz #> <chr> <chr> <dbl> <chr> <dbl> <chr> <dbl> <dbl> <dbl> <chr> #> 1 MB WINNIPEG A … 27174 502S001 71849 XWG 49.9 -97.2 239. Etc/… #> 2 MB WINNIPEG A … 27174 502S001 71849 XWG 49.9 -97.2 239. Etc/… #> 3 MB WINNIPEG A … 27174 502S001 71849 XWG 49.9 -97.2 239. Etc/… #> 4 MB WINNIPEG A … 27525 5023223 NA NA 49.9 -97.2 239. Etc/… #> 5 MB WINNIPEG A … 27525 5023223 NA NA 49.9 -97.2 239. Etc/… #> 6 MB WINNIPEG AN… 3689 5023170 NA NA 49.9 -97.2 NA Etc/… #> 7 MB WINNIPEG AN… 3689 5023170 NA NA 49.9 -97.2 NA Etc/… #> 8 MB WINNIPEG AS… 3690 5023174 NA NA 49.9 -97.2 229. Etc/… #> 9 MB WINNIPEG AS… 3690 5023174 NA NA 49.9 -97.2 229. Etc/… #> 10 MB WINNIPEG BL… 3691 5023178 NA NA 49.9 -97.4 236. Etc/… #> # … with 75 more rows, and 4 more variables: interval <chr>, start <dbl>, #> # end <dbl>, normals <lgl># }