Title: | SpaTiAl resulTs gEneRatOr fOr iMpact (STATEROOM) |
---|---|
Description: | Spatial results generator for IMPACT. |
Authors: | Abhijeet Mishra [aut, cre] |
Maintainer: | Abhijeet Mishra <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.2.0 |
Built: | 2024-11-08 05:15:18 UTC |
Source: | https://github.com/IFPRI/STATEROOM |
FPU Level Crop area
calcCropAreaFPU(gdx, yrs = NULL, crop = NULL)
calcCropAreaFPU(gdx, yrs = NULL, crop = NULL)
gdx |
final GDX from an IMPACT run |
yrs |
Years to subset. Defaults to NULL for all years. |
crop |
Crops to subset. Defaults to NULL for all crops. |
FPU level area_fpu as sf object
Abhijeet Mishra
## Not run: x <- calcCropAreaFPU(gdx)
## Not run: x <- calcCropAreaFPU(gdx)
FPU Level Production
calcProductionFPU(gdx, yrs = NULL, crop = NULL)
calcProductionFPU(gdx, yrs = NULL, crop = NULL)
gdx |
final GDX from an IMPACT run |
yrs |
Years to subset. Defaults to NULL for all years. |
crop |
Crops to subset. Defaults to NULL for all crops. |
FPU level production as sf object
Abhijeet Mishra
## Not run: x <- calcProductionFPU(gdx)
## Not run: x <- calcProductionFPU(gdx)
FPU Level Production
calcYieldFPU(gdx, yrs = NULL, crop = NULL)
calcYieldFPU(gdx, yrs = NULL, crop = NULL)
gdx |
final GDX from an IMPACT run |
yrs |
Years to subset. Defaults to NULL for all years. |
crop |
Crops to subset. Defaults to NULL for all crops. |
FPU level production as sf object
Abhijeet Mishra
## Not run: x <- calcYieldFPU(gdx)
## Not run: x <- calcYieldFPU(gdx)
Plotter for IMPACT results at FPU level
plotSpatial( df, wrap = NULL, ncol = NULL, scale = 1, plot_title = NULL, legend_title = NULL )
plotSpatial( df, wrap = NULL, ncol = NULL, scale = 1, plot_title = NULL, legend_title = NULL )
df |
sf dataframe object. Usually an output from from readFPU() |
wrap |
If the plot needs to be wrapped e.g., in case plotting multiple indicators. For example, use "fctr" if you want to plot irrigated and rainfed areas in case area is being plotted |
ncol |
Number of columns to be plotted. Defaults to NULL. |
scale |
Numeric value to scale output. Use 1e3 for thousand to million conversion for example. Defaults to 1. |
plot_title |
Title of the plot. Defaults to NULL. |
legend_title |
Title of the legend, Defaults to NULL. |
ggplot object with FPU level IMPACT results
## Not run: plotSpatial(df) ## End(Not run)
## Not run: plotSpatial(df) ## End(Not run)
Read FPU level data and merge with FPU shapefile
readFPU(gdx, param_name, data = NULL, yrs = NULL, crop = NULL)
readFPU(gdx, param_name, data = NULL, yrs = NULL, crop = NULL)
gdx |
GDX from IMPACT run |
param_name |
Name of paramter with FPU column in IMPACT model |
data |
If FPU level data is already available. If used, do not provide 'gdx' and 'param_name' information. Defaults to NULL. |
yrs |
Years to subset. HIGHLY recommended to use this for performance reasons as the data frame might be too big to read all years information. |
crop |
Crops to subset if available. HIGHLY recommended to use this for performance reasons as the data frame might be too big to read all crops information - specially if they have additional "fctr" information associated with them like rainfed or irrigated areas. |
Spatial Vector which contains FPU level data from IMPACT
## Not run: readArea(gdx) ## End(Not run)
## Not run: readArea(gdx) ## End(Not run)
Shapefile reader for IMPACT FPUs
readSHP()
readSHP()
Terra object with shapefile constaining FPUs for IMPACT
## Not run: readSHP() ## End(Not run)
## Not run: readSHP() ## End(Not run)