Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/animate_frames.R
animate_frames
creates an animation from a list of frames computed with frames_spatial
.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
frames |
list of |
out_file |
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 |
fps |
numeric, the number of frames to be displayed per second. Default is 2. |
width |
numeric, width of the output animation in pixels. |
height |
numeric, height of the output animation in pixels. |
res |
numeric, resolution of the output animation in ppi. |
end_pause |
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. |
display |
logical, whether the animation should be displayed after rendering or not. |
overwrite |
logical, wether to overwrite an existing file, if |
verbose |
logical, if |
... |
additional arguments to be passed to the render function. |
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.
None or the default image/video viewer displaying the animation
Jakob Schwalb-Willmann
frames_spatial
frames_graph
join_frames
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | 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]]
frames <- frames_spatial(m, r_list = r_list, r_times = r_times, r_type = "gradient",
fade_raster = TRUE)
# customize
frames <- add_colourscale(frames, type = "gradient",
colours = c("orange", "white", "darkgreen"), legend_title = "NDVI")
frames <- add_northarrow(frames, position = "bottomleft")
frames <- add_scalebar(frames, colour = "white", position = "bottomright")
frames <- add_progress(frames)
frames <- add_timestamps(frames, m, type = "label")
# check available formats
suggest_formats()
# animate frames as GIF
animate_frames(frames, out_file = tempfile(fileext = ".gif"))
# animate frames as mov
animate_frames(frames, out_file = tempfile(fileext = ".gif"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.