getDists: getDists

Description Usage Arguments Details Value Author(s) Examples

Description

Get geographic distance to nearest CIMIS stations

Usage

1
2
getDists(lat, lon, n = 1, FUN = distHaversine, cached = TRUE,
  StnInfo = getStationInfo(cached))

Arguments

lat

The latitude, in decimal degrees

lon

longitude, in decimal degrees

n

number of nearest stations to return

FUN

the function used to calculate the distance. Passed to the distm function in the geospheres package

cached

logical, should the cached station information be used, or should a up to the date version be retrieved from CIMIS

StnInfo

object providing details of the CIMIS weather stations. This can be retrieved using getStationInfo or updateStationInfo.

Details

This function gets the nearest n stations from a geographic point.

Value

a subset of StnInfo ordered by distance to the specificed point, with the distance in Km added

Author(s)

Matt Espe

Examples

1
2
#Get the 5 closest stations
getDists(37.8, -121.22, n = 5)

mespe/Rcimis documentation built on May 22, 2019, 6:53 p.m.