View source: R/plot.sim_results.R
plot.sim_results | R Documentation |
sim_results
ObjectPlots abundances obtained during simulation.
## S3 method for class 'sim_results'
plot(x, template = NULL, time_points = NULL, range, type, ...)
x |
|
template |
|
time_points |
numeric vector; specifies points in time from which plots will be generated |
range |
numeric vector of length 2; range of values to be used for the
legend (if |
type |
character vector of length 1; type of map: "continuous" (default), "classes" or "interval" (case-sensitive) |
... |
further arguments passed to |
SpatRaster
object with as many layers
as the length of time_points
parameter
library(terra)
n1_small <- rast(system.file("input_maps/n1_small.tif", package = "rangr"))
K_small <- rast(system.file("input_maps/K_small.tif", package = "rangr"))
sim_data <- initialise(
n1_map = n1_small,
K_map = K_small,
r = log(2),
rate = 1 / 1e3
)
sim_res <- sim(sim_data, time = 10)
plot(sim_res)
plot(sim_res, template = n1_small, time_points = c(1, 10))
# plot specific area
plot(sim_res, xlim = c(4, 10), ylim = c(0, 10))
plot(sim_res, ext = c(4, 10, 0, 10))
plot(sim_res, template = n1_small, ext = c(274000, 280000, 610000, 620000))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.