add_labels: Add labels to frames

View source: R/add_labels.R

add_labelsR Documentation

Add labels to frames

Description

This function adds character labels such as title or axis labels to animation frames created with frames_spatial.

Usage

add_labels(
  frames,
  title = waiver(),
  subtitle = waiver(),
  caption = waiver(),
  tag = waiver(),
  x = waiver(),
  y = waiver(),
  verbose = TRUE
)

Arguments

frames

an object of class moveVis created with frames_spatial.

title

character, frame title. If NULL, an existing title of frames is removed. If waiver() (default, see ggplot2::waiver()), an existing title of frames is kept.

subtitle

character, frame subtitle. If NULL, an existing title of frames is removed. If waiver() (default, see ggplot2::waiver()), an existing title of frames is kept.

caption

character, frame caption. If NULL, an existing title of frames is removed. If waiver() (default, see ggplot2::waiver()), an existing title of frames is kept.

tag

character, frame tag. If NULL, an existing title of frames is removed. If waiver() (default, see ggplot2::waiver()), an existing title of frames is kept.

x

character, label of the x axis. If NULL, an existing title of frames is removed. If waiver() (default, see ggplot2::waiver()), an existing title of frames is kept.

y

character, label of the y axis. If NULL, an existing title of frames is removed. If waiver() (default, see ggplot2::waiver()), an existing title of frames is kept.

verbose

logical, if TRUE, messages and progress information are displayed on the console (default).

Value

A frames object of class moveVis.

Author(s)

Jakob Schwalb-Willmann

See Also

frames_spatial frames_graph animate_frames

Examples

library(moveVis)
library(move)

data("move_data", "basemap_data")
m <- align_move(move_data, res = 4, unit = "mins")

# create spatial frames using a custom NDVI base layer
r_list <- basemap_data[[1]]
r_times <- basemap_data[[2]]

## Not run: 
frames <- frames_spatial(m, r_list = r_list, r_times = r_times, r_type = "gradient",
                         fade_raster = TRUE)

# add labels to frames:
frames <- add_labels(frames, title = "Example animation using moveVis::add_labels()", 
                     subtitle = "Adding a subtitle to frames created using frames_spatial()",
                     caption = "Projection: Geographical, WGS84. Sources: moveVis examples.",
                     x = "Longitude", y = "Latitude")
# have a look at one frame
frames[[100]]

## End(Not run)


16EAGLE/moveVis documentation built on March 4, 2024, 1:35 a.m.