<- roleParams(niter=10000,niterTimestep = 100) my_params
11 Your first RoLE model
Let’s go through the steps of running simple neutral model.
11.1 Model specification
First we make a roleParams object to contain the parameters for our model. The roleParams constructor has defaults for all 19 params, here we just change the number of iterations and how often to save the model state.
Then we make a roleModel object using these params.
<- roleModel(my_params) my_model
11.2 Running
To run, we call runRole on the model.
<- runRole(my_model) my_model
11.3 Results and interpretation
Finally let’s visualize a simple result - the species richness of the local community over time.
<- getSumStats(my_model)
my_model_stats
library(ggplot2)
ggplot(my_model_stats, aes(iteration, richness)) +
geom_line()