getStationsByCity: Get k-nearest station data

Description Usage Arguments Value Examples

Description

This function utilizes the kNStation() function to find the k-nearest stations, and downloads all the data for those stations in between a given date range (in years).

Usage

1
getStationsByCity(city.list, station.list, k = 5, begin, end)

Arguments

city.list

City of list of Cities. The format should be as follows: "City, State", or "City, Country"

station.list

Full list of ISD stations included in the package

k

The number of stations to return

begin

Start year (4 digits)

end

End year (4 digits)

Value

Returns a list of two items.

1) Status of downloading each year's data for each station 2) A list of dataframes. Each dataframe is all years data of a particular station.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
data(stations)
cities <- c("Nairobi, Kenya", "Tema, Ghana", "Accra, Ghana", "Abidjan, Ivory Coast")
get.stations <- getStationsByCity(cities, station.list, begin = 2012, end = 2013)
get.stations$dl_status
class(get.stations$station_data)
length(get.stations$station_data)

## End(Not run)

mpiccirilli/weatheR documentation built on May 23, 2019, 6:28 a.m.