Description Usage Arguments Details Value Examples
This function applies 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
1 2 | getInterpolatedDataByCity(city.list, station.list, k = 5, begin, end,
distance = 100, hourly_interval = 3, tolerance = 0.05)
|
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) |
It then performs two steps to interpolate missing values: 1) Average over all data points in original dataset to find average hourly observations 2) Linearly interpolate hourly data points for missing observations
Returns a single dataframe with hourly observations (including interpolated) of every city.
1 2 3 4 5 6 7 | ## Not run:
data(stations)
cities <- c("Nairobi, Kenya", "Tema, Ghana", "Accra, Ghana", "Abidjan, Ivory Coast")
hourly.data <- getInterpolatedDataByCity(cities, station.list, 5, 2010, 2013, 100, 3, .05)
dim(hourly.data)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.