stationFromCoords: Identify GSOD stations in the vicinity of a given geographic...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/stationFromCoords.R

Description

This function allows the selection of a subset of GSOD stations based on a specified location and a desired buffer size.

Usage

1

Arguments

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 SpatialPoints.

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 round.

Value

An object of class SpatialPointsDataFrame.

Author(s)

Florian Detsch

See Also

geodist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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)

mapGriddedData(mapRegion = "africa", plotData = FALSE, borderCol = "black",
               addLegend = FALSE)
points(gsod_shp, col = "red", pch = 20, cex = 2)

# Alternatively
gsod_shp <- stationFromCoords(x = c(37.359031, -3.065053),
                              width = 100)

# Alternatively
kibo <- data.frame(x = 37.359031, y = -3.065053)
coordinates(kibo) <- ~ x + y
projection(kibo) <- CRS("+init=epsg:4326")

gsod_shp <- stationFromCoords(x = kibo,
                              width = 100)

environmentalinformatics-marburg/eimarGsodTools documentation built on May 13, 2017, 6:11 p.m.