Learn R Programming

rclimateca (version 1.0.3)

ec_climate_search_locations: Search climate locations

Description

Search climate locations

Usage

ec_climate_search_locations(query = NULL, ..., timeframe = c("NA",
  "monthly", "daily", "hourly"), year = NULL, limit = NULL)

ec_climate_geosearch_locations(query = NULL, ..., timeframe = c("NA", "monthly", "daily", "hourly"), year = NULL, limit = NULL)

Arguments

query

A query in several forms

...

Additional arguments are used to filter ec_climate_locations_all

timeframe

The target timeframe for the query

year

An optional year when the location must have data

limit

The maximum number of locations to return (or NULL for no limit). Lon/lat queries are automatically capped at 30 locations.

Examples

Run this code
# NOT RUN {
# character searches match the location column of ec_climate_locations_all
# (case-insensitive)
ec_climate_search_locations("ottawa")

# multiple values use OR logic
ec_climate_search_locations(c("ottawa on", "halifax"))

# you can use a year and a timeframe to find locations that are known to have some
# data for that year/timeframe
ec_climate_search_locations("ottawa", year = 2016)
ec_climate_search_locations("ottawa", timeframe = "daily", year = 2016)

# you can also use a vector of years
ec_climate_search_locations("ottawa", timeframe = "daily", year = 2000:2016)

# if you need to search geographically, you can pass a numeric vector in the form
# c(lon, lat)
ec_climate_search_locations(c(-75.69031, 45.42111))

# }
# NOT RUN {
# to use a human readable geocoded location, use ec_climate_geosearch_locations()
ec_climate_geosearch_locations("ottawa on")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab