pptprism {acdcR} | R Documentation |
Calculating precipitation by PRISM grids or Counties with PRISM raster
Description
The function calculates the precipitation (mm) by grids or counties directly from a PRISM raster.
Usage
pptprism(mmprism, year, out = NULL)
Arguments
mmprism |
A PRISM raster of the precipitation |
year |
year of the PRIsM raster |
out |
Output value type: precipitation by PRISM grids or Counties (default = Counties) |
Details
pptprism
is a function for calculating precipitation (mm) by PRISM grids or Counties directly from a PRISM raster.
The out
is to specify the output values.
- out = 'grid'
: precipitation by PRISM grids projected on the NLCD map
- out = 'stco'
: precipitation by Counties of 2017 Agricultural Census (default)
If out
is not specified, 'stco' is set as default.
When out='stco'
is specified, the weights are applied as:
- year < 2004: agricultural areas in 2001 NLCD
- year = 2004 or 2005: agricultural areas in 2004 NLCD
- year = 2006 or 2007: agricultural areas in 2006 NLCD
- year = 2008, 2009, or 2010: agricultural areas in 2008 NLCD
- year = 2011 or 2012: agricultural areas in 2011 NLCD
- year = 2013, 2014, or 2015: agricultural areas in 2013 NLCD
- year = 2016, 2017, or 2018: agricultural areas in 2016 NLCD
- year >= 2019: agricultural areas in 2019 NLCD
To get a PRIMS raster, follow the instruction at https://prism.oregonstate.edu/documents/PRISM_downloads_FTP.pdf.
Value
A data.frame including precipitation (ppt), PRISM grid numbers (gridNum), or FIPS codes (stco)
See Also
Examples
#######################################################
## Note: Need a PRISM raster to run this code
#######################################################
## Not run:
## PRISM data import
pptdata <- raster('./PRISM_ppt_stable_4kmD2_19960701_bil.bil')
## precipitation over Counties
result <- pptprism(pptdata,1996)
result2 <- pptprism(pptdata,1996,'stco')
## precipitation over PRISM grids
result3 <- pptprism(pptdata,1996,'grid')
## End(Not run)