View source: R/stationFromCoords.R
stationFromCoords | R Documentation |
This function allows the selection of a subset of GSOD stations based on a specified location and a desired buffer size.
stationFromCoords(x, y = NULL, width = 50, ...)
x |
Numeric. A a single number specifying the x (longitude) coordinate,
or a vector of two numbers specifying the x and y (latitude) coordinate, or
an object of class |
y |
Numeric, default is NULL. A single number specifying the y coordinate. Note: if a vector of two numbers is supplied to the previous argument, this parameter will automatically be ignored. |
width |
Numeric, default is 50. The desired buffer width (km) that will be applied to the specified coordinate. |
... |
Additional arguments passed to |
A sf
object.
Florian Detsch
geodist
# Identify GSOD stations that lie within a distance of 100 km around Kibo summit
gsod_shp <- stationFromCoords(x = 37.359031,
y = -3.065053,
width = 100)
rworldmap::mapGriddedData(mapRegion = "africa", plotData = FALSE, borderCol = "black",
addLegend = FALSE)
points(sf::st_coordinates(gsod_shp), col = "red", pch = 20, cex = 2)
# Alternatively
gsod_shp <- stationFromCoords(x = c(37.359031, -3.065053),
width = 100)
# Alternatively
kibo = sf::st_as_sf(
data.frame(
x = 37.359031
, y = -3.065053
)
, crs = 4326
, coords = c("x", "y")
)
gsod_shp <- stationFromCoords(x = kibo,
width = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.