animate_annual: Plot an animation of forest change within a given area of...

View source: R/animate_annual.R

animate_annualR Documentation

Plot an animation of forest change within a given area of interest (AOI)

Description

Produces an animation of annual forest change in the area bounded by the extent of a given AOI, or AOIs. The AOI polygon(s) is(are) also plotted on the image. The gfc_stack must be pre-calculated using the annual_stack function. The animation can be either an animated GIF (if type is set to 'gif') or a series of '.png' files with a corresponding '.html' webpage showing a simple viewer and the forest change animation (if type is set to 'html'). The HTML option is recommended as it requires no additional software to produce it. The animated GIF option will only work if the imagemagicK software package is installed beforehand (this is done outside of R).

Usage

animate_annual(
  aoi,
  gfc_stack,
  out_dir = getwd(),
  out_basename = "gfc_animation",
  site_name = "",
  type = "html",
  height = 3,
  width = 3,
  dpi = 300,
  dataset = "GFC-2022-v1.10"
)

Arguments

aoi

one or more AOI polygons as a SpatialPolygonsDataFrame or sf object. If there is a 'label' field in the dataframe, it will be used to label the polygons in the plots. If the AOI is not in the WGS84 geographic coordinate system, it will be reprojected to WGS84.

gfc_stack

a GFC product subset as a RasterStack (as output by annual_stack)

out_dir

folder for animation output

out_basename

basename to use when naming animation files

site_name

name of the site (used in making title)

type

type of animation to make. Can be either "gif" or "html"

height

desired height of the animation GIF in inches

width

desired width of the animation GIF in inches

dpi

dots per inch for the output image

dataset

which version of the Hansen data to use annual_stack was run

See Also

annual_stack


gfcanalysis documentation built on Oct. 11, 2023, 5:15 p.m.