This package stores, compiles, summarizes and visualizes climate data for NETN park centroids. Package primarily relies on NOAA gridded climate data (see www.ncei.noaa.gov for more information), which include monthly gridded data from 1895 through to present day and 2 sets of normals- 1901 to 2000 (20th century), and 1991 to 2020 (30-year normal). Climate data are compiled for NETN park centroids. Each function in the climateNETN package has help documentation that includes examples.
The R package can be installed using pak::pkg_install('doi-nps/climateNETN'). Previous archived versions of this R package can be found at www.github.com/katemmiller/climateNETN
This package includes the following functions:
- getClimDaymet: Download daily Daymet gridded climate data directly from REST
- getClimDrought: Download weekly county-level drought index
- getClimNOAA: Download monthly gridded NOAA climate data
- getClimWStat: Download daily data from nearest weather station
- plotClimAnom: Plot climate anomalies from baseline normal
- plotClimBar: Plot climate trends as bar plot
- plotClimComps: Plot climate comparisons between monthly historical normals and user-specified year
- plotClimCumPrecip: Plot cumulative precipitation relative to historic normals
- plotClimDrought: Plot weekly drought based on county-level drought index
- plotClimRel: Plot climate data relative to average value from historic normals
- plotClimTrend: Plot monthly climate trends for a given time period
- sumStatsTable: Summarize monthly climate records
- theme_NETN: ggplot2 theme for climateNETN package
The scripts/ folder contains scripts used to compile monthly climate statistics for each NETN park centroid using NOAA gridded cliamte data. To update data for the the climate summary report, use the compile_NOAA_1895_present.R script. The last section of code is set up to update for a new month.
The data/ folder stores data to make the functions run faster, including NETN centroids, NETN climate normals, NETN monthly climate data, weekly drought statistics, closest weather station to each park,
The docs/ folder includes the R Markdown files that generate the NETN climate summary. The index.Rmd generates the index.html, which is the file used by the gitpage for this repo.
Steps to update the NETN climate summary for a new month:
- Update NETN_drought_weekly.rda and NETN_clim_annual.rda by opening scripts/compile_NOAA_1895_present.R. Starting at line 67, update the month and year and rerun to end of script. It typically takes about 2 weeks for a new month of data to be posted. You will receive an error that the data are not available for that time period if the data have not been posted yet.
- Rebuild the climateNETN package to update the data that installs with that package.
- Update the params in docs/index.Rmd to cover the latest month of data. Note the end_date is also used for the drought data.
- Knit the index.Rmd, and check that the latest month was included.
- Push the latest index.html, index.Rmd, and updated data files to github. A few minutes later the summary report should be updated.