21 Using R for data access
21.1 Overview
For many USACE-focused analyses, it is crucial to access Federal data sources, including ones that pertain to hydrology, watershed boundaries, weather, infrastructure, or land cover, among other features. For analyses being conducted within R, it can be extremely helpful to access these data sources directly from within R. Doing so creates an exact record of the data that was accessed, and helps with keeping analyses and data records organized and reproducible.
This section of modules includes two full workflows for accessing hydrological data, as well as watershed-focused data. Below, we list additional data sources and associated r packages that may be of use for USACE-focused analyses.
21.2 Other datasources to consider
21.2.1 National Land Cover Dataset
The National Land Cover Dataset can be accessed using the FedData package.
21.2.2 Weather data
Precipitation and temperature data from the long-term Oregon State University PRISM initiative can be accessed with the prism package in R.
21.2.3 Dam data
The National Inventory of Dams dataset can be accessed using the dams package.
###Code for hydraulic model (i.e., HEC-RAS) output files
Various R functions exist to perform post-processing on files generated from HEC-RAS modeling (e.g., DSS, netCDF). For example the dssrip2 package can be used to create, read, and write the .dss files associated with hydraulic modeling in HEC-RAS.