stations_search | R Documentation |
Returns stations that match the name provided OR which are within dist
km of the location provided. This is designed to provide the user with
information with which to decide which station to then get weather data from.
stations_search(
name = NULL,
coords = NULL,
dist = 10,
interval = c("hour", "day", "month"),
normals_years = NULL,
normals_only = NULL,
stn = NULL,
starts_latest = NULL,
ends_earliest = NULL,
verbose = FALSE,
quiet = FALSE
)
name |
Character. A vector of length 1 or more with text against which
to match. Will match station names that contain all components of
|
coords |
Numeric. A vector of length 2 with latitude and longitude of a
place to match against. Overrides |
dist |
Numeric. Match all stations within this many kilometres of the
|
interval |
Character. Return only stations with data at these intervals. Must be any of "hour", "day", "month". |
normals_years |
Character. One of |
normals_only |
DEPRECATED. Logical. Return only stations with climate normals? |
stn |
DEFUNCT. Now use |
starts_latest |
Numeric. Restrict results to stations with data collection beginning in or before the specified year. |
ends_earliest |
Numeric. Restrict results to stations with data collection ending in or after the specified year. |
verbose |
Logical. Include progress messages |
quiet |
Logical. Suppress all messages (including messages regarding missing data, etc.) |
To search by coordinates, users must make sure they have the sp package installed.
The current
, most recent, climate normals year range is 1981-2010
.
Returns a subset of the stations data frame which match the search
parameters. If the search was by location, an extra column 'distance' shows
the distance in kilometres from the location to the station. If no stations
are found withing dist
, the closest 10 stations are returned.
stations_search(name = "Kamloops")
stations_search(name = "Kamloops", interval = "hour")
stations_search(name = "Ottawa", starts_latest = 1950, ends_earliest = 2010)
stations_search(name = "Ottawa", normals_years = "current") # 1981-2010
stations_search(name = "Ottawa", normals_years = "1981-2010") # Same as above
stations_search(name = "Ottawa", normals_years = "1971-2000") # 1971-2010
if(requireNamespace("sf")) {
stations_search(coords = c(53.915495, -122.739379))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.