plot_allocation: Plotting allocation of croptypes in a landscape

View source: R/graphics.R

plot_allocationR Documentation

Plotting allocation of croptypes in a landscape

Description

Plots croptype allocation in the landscape at a given year of the simulation

Usage

plot_allocation(
  landscape,
  year,
  croptype_names = c(),
  title = "",
  subtitle = "",
  filename = "landscape.png"
)

Arguments

landscape

a SpatialPolygonsDataFrame

year

year to be plotted

croptype_names

croptype names (for legend)

title

title of the graphic

subtitle

subtitle of the graphic

filename

name of the .png file to be generated

Value

a png file.

See Also

plotland

Examples

## Not run: 
landscape <- landscapeTEST1
croptypes <- data.frame(sample.int(3, length(landscape), replace = TRUE))
allocation <- SpatialPolygonsDataFrame(landscape, croptypes, match.ID = TRUE)
plot_allocation(allocation, 1,
  title = "Simulated landscape", subtitle = "Year 1",
  filename = paste(getwd(), "/landscape.png", sep = "")
)

## End(Not run)

landsepi documentation built on July 26, 2023, 5:36 p.m.