spatialanimation: Function for ploting simulation as a gif

Description Usage Arguments Author(s) Examples

Description

The spatialanimation function plots the individuals of the selected stages over time. Use plotsnapshot for plotting a single instant.

Usage

1
2
3
4
5
6
7
spatialanimation(data, times = seq(0, data$maxtime, length.out = 50),
  interval = 0.1, draw = data$num.total:1,
  radius = data$param$radius[draw], color = colorRampPalette(c("darkred",
  "lightgreen"))(length(draw)), movie.name = "facilitationmovie.gif",
  xlim = c(0, data$w), ylim = c(0, data$h))

plotsnapshot(data, t, ...)

Arguments

data

result of a simulation, created by community

times

array of times at which to plot

interval

a time length to wait between frames

draw

an array of stages id, to be drawn bottom to top. Absent stages will not be drawn.

radius

Optional. Array representing the sizes in which the individuals will be drawn. Defaults to interaction radius.

color

Optional. A color vector

movie.name

The filename of the gif that will be saved.

xlim

Optional. Limits to the x-axis

ylim

Optional. Limits to the y-axis

t

a single time at which to plot

...

additional parameters to be passed to spatialanimation

Author(s)

Alexandre Adalardo de Oliveira - 16/03/2016

M. Salles

Examples

1
2
3
4
data(twospecies)
spatialanimation(twospecies,draw=c(5,3),times=seq(0,10,1),movie.name="ts.gif")
data(twospecies)
plotsnapshot(twospecies,t=10)

facilitation documentation built on May 2, 2019, 5:54 a.m.