Learn R Programming

ColOpenData (version 1.0.0)

stations_in_roi: Stations in region of interest

Description

Download and filter climate stations contained inside a region of interest (ROI).

Usage

stations_in_roi(geometry)

Value

data.frame object with the stations contained inside the consulted geometry.

Arguments

geometry

sf object containing the geometry for a given ROI. The geometry can be either a POLYGON or MULTIPOLYGON.

Examples

Run this code
if (FALSE) { # identical(tolower(Sys.getenv("NOT_CRAN")), "true")
# \donttest{
lat <- c(5.166278, 5.166278, 4.982247, 4.982247, 5.166278)
lon <- c(-75.678072, -75.327859, -75.327859, -75.678072, -75.678072)
polygon <- sf::st_polygon(x = list(cbind(lon, lat)))
geometry <- sf::st_sfc(polygon)
roi <- sf::st_as_sf(geometry)
stations <- stations_in_roi(roi)
head(stations)
# }
}

Run the code above in your browser using DataLab