animate_frames creates an animation from a list of frames computed with frames_spatial.

animate_frames(frames, out_file, fps = 25, width = 700, height = 700,
res = 100, end_pause = 0, display = TRUE, overwrite = FALSE,
verbose = TRUE, ...)

## Arguments

frames list of ggplot2 objects, crated with frames_spatial. character, the output file path, e.g. "/dir/to/file.mov". The file extension must correspond to a file format known by the available renderers of the running system. Use suggest_formats to get a vector of suggested known file formats. numeric, the number of frames to be displayed per second. Default is 2. numeric, width of the output animation in pixels. numeric, height of the output animation in pixels. numeric, resolution of the output animation in ppi. numeric, defining how many seconds the last frame of the animation should be hold to add a pause at the the end of the animation. Default is 0 seconds to not add a pause. logical, whether the animation should be displayed after rendering or not. logical, wether to overwrite an existing file, if out_file is already present. logical, if TRUE, messages on the function's progress are displayed (default). additional arguments to be passed to the render function.

## Value

None or the default image/video viewer displaying the animation

## Details

An appropriate render function is selected depending on the file extension in out_file: For .gif files, gifski::save_gif is used, for any other (video) format, av::av_capture_graphics is used.

frames_spatial frames_graph join_frames

## Examples

# NOT RUN {
library(moveVis)
library(move)

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

# create spatial frames with frames_spatial:
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",

# customize
colours = c("orange", "white", "darkgreen"), legend_title = "NDVI")
frames <- add_northarrow(frames, position = "bottomleft")
frames <- add_scalebar(frames, colour = "white", position = "bottomright")

# }