getFilteredStationsByCity: Get k-nearest station data, Filtered

Description Usage Arguments Value Examples

Description

This function returns 1 station for each city, after applying four filters: 1) Remove stations with little to no data 2) Remove stations that exceed a maximum distance from each city's reference point 3) Remove stations that exceed a threshold of missing data, including NA values 4) Select closest station remaining for each city, as all remaining stations are deemed adequate

Usage

1
2
getFilteredStationsByCity(city.list, station.list, k = 5, begin, end,
  distance = 100, hourly_interval = 3, tolerance = 0.05)

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)

distance

Maximum distance allowable from each city's reference point

hourly_interval

Minimum hourly interval allowable (1=hourly; 3 = every 3 hours; 6 = every 6 hours, etc..)

tolerance

This is the percent, in decimals, of missing data you will allow. (.05 = 5% of total data)

Value

Returns a list of four items. 1) Download status. 2) Number of downlaoded, removed, and kept stations 3) Names of final stations 2) A list of dataframes for each station.

Examples

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

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.