Package 'STATEROOM'

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

Help Index


FPU Level Crop area

Description

FPU Level Crop area

Usage

calcCropAreaFPU(gdx, yrs = NULL, crop = NULL)

Arguments

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.

Value

FPU level area_fpu as sf object

Author(s)

Abhijeet Mishra

Examples

## Not run: x <- calcCropAreaFPU(gdx)

FPU Level Production

Description

FPU Level Production

Usage

calcProductionFPU(gdx, yrs = NULL, crop = NULL)

Arguments

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.

Value

FPU level production as sf object

Author(s)

Abhijeet Mishra

Examples

## Not run: x <- calcProductionFPU(gdx)

FPU Level Production

Description

FPU Level Production

Usage

calcYieldFPU(gdx, yrs = NULL, crop = NULL)

Arguments

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.

Value

FPU level production as sf object

Author(s)

Abhijeet Mishra

Examples

## Not run: x <- calcYieldFPU(gdx)

Plotter for IMPACT results at FPU level

Description

Plotter for IMPACT results at FPU level

Usage

plotSpatial(
  df,
  wrap = NULL,
  ncol = NULL,
  scale = 1,
  plot_title = NULL,
  legend_title = NULL
)

Arguments

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.

Value

ggplot object with FPU level IMPACT results

Examples

## Not run: 
plotSpatial(df)

## End(Not run)

Read FPU level data and merge with FPU shapefile

Description

Read FPU level data and merge with FPU shapefile

Usage

readFPU(gdx, param_name, data = NULL, yrs = NULL, crop = NULL)

Arguments

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.

Value

Spatial Vector which contains FPU level data from IMPACT

Examples

## Not run: 
readArea(gdx)

## End(Not run)

Shapefile reader for IMPACT FPUs

Description

Shapefile reader for IMPACT FPUs

Usage

readSHP()

Value

Terra object with shapefile constaining FPUs for IMPACT

Examples

## Not run: 
readSHP()

## End(Not run)