Learn R Programming

steps (version 1.3.0)

plot.simulation_results: Plot the results of a simulation

Description

Methods to visually inspect the results of a simulation. Both linear graphs and spatial-explicit grids are generated for all timesteps to illustrate population changes through time and space. Note, this function can be wrapped in a *png()* call to write several images to disk for creating animations.

Usage

# S3 method for simulation_results
plot(x, replicates = 1, ...)

Arguments

x

a simulation_results object

replicates

which replicates to plot (default is one, or the first)

...

further arguments passed to/from other methods

Examples

Run this code

if (FALSE) {
ls <- landscape(population = egk_pop, suitability = egk_hab, carrying_capacity = egk_k)

pd <- population_dynamics(change = growth(egk_mat),
                          dispersal = kernel_dispersal(max_distance = 2000,
                                        dispersal_kernel = exponential_dispersal_kernel(
                                          distance_decay = 1000)),
                          density_dependence = ceiling_density())

sim <- simulation(landscape = ls,
                  population_dynamics = pd,
                  habitat_dynamics = NULL,
                  timesteps = 20)

# Plot the spatial distributions of total cell populations
plot(sim) 
}

Run the code above in your browser using DataLab