dates: a character vector , projection dates in format "YYYY-MM-DD".
projection.type: a character string, the type of distribution or abundance projection to plot. One of proportional, binary, abundance and stacked.
drive.folder: optional; a character string, the Google Drive folder to read projection rasters from. Folder must be uniquely named within Google Drive. Do not provide path.
user.email: optional; a character string, user email for initialising Google Drive. Required if drive.folder or save.drive.folder used.
local.directory: optional; a character string, the path to local directory to read projection rasters from.
save.drive.folder: optional; a character string, Google Drive folder to save GIF to. Folder must be uniquely named within Google Drive. Do not provide path.
save.directory: optional; a character string, path to local directory to save GIF to.
width: optional; a numeric value, the GIF width in inches Default = 480.
height: optional; a numeric value, the GIF height in inches Default = 480.
legend.max: optional; a numeric value, the maximum limit of legend values to standardise across projections.
legend.min: optional; a numeric value, the minimum limit of legend values to standardise across projections.
legend.name: optional; a character string, the name for the legend title. Default = projection.type.
file.name: optional, a character string, the name for the output GIF file. Default = projection.type.
borders: a logical indicating whether to add country borders to map. Default = FALSE.
border.regions: optional; a character string or vector, the region or regionss for which to add map borders. Required if borders = TRUE.
border.colour: optional; a character vector, the colour for plotted map borders. Default = black.
colour.palette.custom: optional; a character string or vector, the colours to use as plot colour palette.
colour.palette: optional; a character string, the colormap option to use from viridis. See details for colour palette options.
Returns
Exports GIF to Google Drive folder or local directory.
Details
Function reads in projection rasters for each date. These are plotted using ggplot2 and combined into a Graphics Interchange Format (GIF).
Import projection rasters
Projection rasters for each date must be “tif” files that are uniquely named with the date in format "YYYY-MM-DD" and projection.type. If more than one file name matches the date and projection.type, the function will error.
Google Drive compatibility
If drive.folder or save.drive.folder is given, please ensure the folder name is unique within your Google Drive. Do not provide the path if the folder is nested within others.
If one of drive.folder or save.drive.folder are used then user.email is required to access the appropriate Google Drive user account. This requires users to have installed R package googledrive and initialised Google Drive with valid log-in credentials. Please follow instructions on https://googledrive.tidyverse.org/.
Options for colour palettes using viridis are illustrated at: https://ggplot2.tidyverse.org/reference/scale_viridis.html. Available options include: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), "viridis" (or "D", the default option), "cividis" (or "E"), "rocket" (or "F"), "mako"(or "G") and "turbo" (or "H").