close_stations: Find weather stations that are close to a specified location.

Description Usage Arguments Value Examples

View source: R/incoming_data.R

Description

This is the underlying distance function for finding close weather records. If neither radius or n is specified, the entire station_data data frame will be returned.

Usage

1
2
3
close_stations(sample_coords = stop("Sample coords c(lon,lat) required."),
  station_data = stop("Station data with lon, lat cols rqrd."),
  radius = NULL, n = 10)

Arguments

sample_coords

The cbind(lon, lat) of the experiment, in decimal degrees, negative south and west.

station_data

A data frame of the weather station metadata, with lon, lat columns, in decimal degrees, negative south and west.

radius

The search limit in km. Default: no limit.

n

The number of stations to return. Default: no limit.

Value

A subset of the original station_data data frame, with an additional distance column (km), sorted by distance.

Examples

1
2
3
4
5
require(tempcyclesdata)
close_stations(sample_coords = c(9.0556, 48.52),
               station_data = tempcyclesdata,
               radius = 100,
               n      = 20)

georgebiogeekwang/tempcycles documentation built on May 17, 2019, 1:15 a.m.