# data preparation
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(
n = n1_small,
r = log(2),
K_map = K_small,
max_dist = 1000,
rate = 1 / 1e3
)
sim_results <- sim(sim_data, time = 10)
summary(sim_results)
sim_results_cropped <- subset(sim_results, time_points = c(1:2))
summary(sim_results_cropped)
Run the code above in your browser using DataLab