Below are descriptions of the scripts used to make a range-wide integral projection model for Pinus edulis based on USFS forest inventory data
Preprocessing
- Code/BasalArea/createSurface.R: creates a points shapefile of plot basal area to be used as input for creating a spatial surface of basal area; uses FIA data; creating basal area map is done using interpolation in ArcGIS
- Code/CensusProcessing/censusProcessing.R: takes all FIA plots, subsets AZ, CO, NM, UT plots; combines all tree and condition records for these states as well
- Code/CensusProcessing/createOccurrences.R: takes the processed recruitment data, and uses it to create a points shapefile of pinon occurrences
- Code/ClimateProcessing/current.R: creates annual and seasonal normals from PRISM data for current time
- Code/ClimateProcessing/normals.R: creates monthly normals from PRISM data for current time
- Code/ClimateProcessing/future.R: creates seasonal normals from WorldClim data for future time
- Code/ClimateProcessing/historic.R: creates raster stacks from PRISM data for historic time
- Code/ElevationProcessing/createSurface.R: creates elevation raster from SRTM
Vital rate models
Growth
- Code/Growth/dataPrepGrowth.R: creates data frame for input variables to create growth model
- Code/Growth/modelSelection.R: selects growth models and creates figures (e.g. marginal effect plots)
Survival
- Code/Survival/dataPrepSurvival.R: creates data frame for input variables to create survival model
- Code/Survival/modelSelection.R: selects survival models and creates figures (e.g. marginal effect plots)
Recruitment
- Code/Recruitment/dataPrepRecruitment.R: creates data frame for input variables to create recruitment model
- Code/Recruitment/modelSelection.R: selects recruitment models and creates figures (e.g. coefficient plot, observed versus predicted recruitment)
- Code/Recruitment/recruitSize.R: calculates mean size and SD of size of recruits (needed for kernel)
GAMS
- Code/GAMs/vital_gams.R: runs GAM models for growth, survival, and recruitment. Saves output to be used in IPMs.
IPM
- Code/IPMBinSize/IPM_binSize.R: selects a bin size for the IPM kernel
- Code/IPM/BuildIPM.R: creates the vital rate functions and the function for the IPM kernal
- Code/IPM/EvalIPM.R: uses the IPM function from BuildIPM.R and predictor rasters to do spatial projections of lambda
- Code/IPM/diagnosticPlots.R: creates plots of lambda and vital rates as a function of input variables
- Code/IPM/LTRE.R: uses the IPM function from BuildIPM.R and predictor rasters to do life table response experiment and elasticity analysis
- Code/IPM/Bootstrapping.R: uses the IPM function from BuildIPM.R and predictor rasters to calculate uncertainty around lambda estimates, using bootstrapping
Validation
- Code/Validation/prepFIAPresenceAbsence.R: creates a raster of cells coding pinon presence/absence
- Code/Validation/ResidualAnalysis.R: uses output of EvalIPM.R and prepFIAPresenceAbsence to validate models using occurrence data and residual analysis
Data visualization
- Code/Plots/PIED_plots_resid.R: creates plots of predictors vs vital rates, using vital rate models (linear models, with quadratic terms)
- Code/Plots/PIED_plots_lin_resid.R: creates plots of predictors vs vital rates, using vital rate models (linear models, without quadratic terms)
- Code/Plots/PIED_plots_gam.R: generates data frames with output of vital rate models (GAMS) and predictors to use for plots of predictors vs vital rates; these dataframes get passed to PIED_plots_all.R
- Code/Plots/PIED_plots_all.R: uses data from IPM scripts, validation scripts, and PIED_plots_all.R to create figures used in the manuscript Schultz et al.
Fire
- Code/Fire/Fire_prelim.R: uses FIA data to calculate mortality rates of Pinus edulis in surface and crown fires used in Discussion in Schultz et al.