procWeather | R Documentation |
procWeather
Take output from getWeatherStationData, get sliding window average
temperatures and cumulative precipiation. Use ggplot2 to plot these.
procWeather(histWeather, years2plot = c(2016, 2017), siteLevels = NULL,
plotit = T)
histWeather |
Output from getWeatherStationData |
years2plot |
Numeric, The years that will be plotted as individual lines. The other years in the dataset will be averaged into "historical" data. |
siteLevels |
Character, The levels to use for the names of the sites. If specified, ensure that all sites are included - these will be the only ones that will be plotted. |
plotit |
Logical, should a plot be drawn. |
date_max |
The latest data that must have data from the station. See rnoaa::meteo_nearby_stations. |
limit |
The maximum number of stations to search. If none of these stations have sufficient data, an error is returned. See rnoaa::meteo_nearby_stations. |
verbose |
Logical, should status updates be printed? |
... |
Not currently in use. |
This function iterates through NOAA weather collection sites, deterimining whether the data collected satisfies the time and datatype constraints specified.
A data.frame of daily weather data for each location id. If more than one id are included, the data.frames are placed in a named list.
## Not run:
ll = data.frame(latitude = c(27.54986,30.38398),
longitude = c(-97.88101,-97.72938),
id = c("KING","PKLE"),
stringsAsFactors = F)
data(station_data)
histWeather<-getWeatherStationData(lat_lon_df = ll,
station_data = station_data,
date_min = "2000-01-01",
hasCols = c("prcp","tmax","tmin"),
date_max = "2016-12-31")
lapply(histWeather, head)
out = procWeather(histWeather=histWeather, years2plot = 2012:2016)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.