Description Usage Arguments Details Value See Also
Animate temporal habitat and abundance dynamics on a gridded landscape.
1 2 3 4 5 |
dat |
A |
habitat |
A RasterStack or RasterBrick object. The number of Raster
layers should equal the number of simulation time steps. Further, the
layers should be ordered temporally, and should correspond to the levels of
|
outfile |
A character string giving the desired output path and filename. |
zlim |
A numeric vector of length 2 giving the lower and upper limits of the color scale indicating habitat quality. If this is not provided, a pretty range will be calculated (though this will impact efficiency). |
axes |
Logical. Should axes be drawn? |
col.regions |
A |
pt.col |
A |
pt.cex |
Point size magnifier, relative to the default. |
height |
Numeric. The height of the animation, in pixels. Default is 800. |
width |
Numeric. The width of the animation, in pixels. Default is 800. |
interval |
The time interval of the animation, in seconds. Default is 0.05, i.e. 20 frames per second. |
label |
Should a time step counter be plotted? |
label.pos |
A vector of two numbers giving the normalised parent
coordinates at which the time step counter will be plotted. The first
number gives the x-coordinate (0 = left edge, 1 = right edge) and the
second gives the y-coordinate (0 = bottom edge, 1 = top edge). The default
value of |
label.just |
Justification of the time step counter label, relative to
|
label.cex |
Size of the time step counter text. Ignored if |
label.font |
Font face of the time step counter text. See
|
overwrite |
Should |
mp_animate
requires that either
http://www.imagemagick.org or
http://www.graphicsmagick.org are installed on the
system. See the documentation for
animation::im.convert
for further details.
An animated gif is created, with points indicating the location of populations with mean abundance greater than zero, overlaid upon a raster grid indicating habitat suitability. Relative population size is represented by point colour, with white corresponding to a population with mean abundance between 0 and 1 populations and time steps, and black corresponding to the maximum mean abundance. Colours for intermediate values are scaled linearly. The colour key indicates carrying capacity, and corresponds to the colour of grid cells.
An example of this function's use is provided in the vignette "Introduction
to mptools" (vignette('intro', 'mptools')
).
NULL
. The animation is saved as an animated .gif file at the
specified path (outfile
).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.