
Add progress bar to frames
add_progress.Rd
This function adds a progress bar to frames created with frames_spatial
.
Arguments
- frames
an object of class
moveVis
created withframes_spatial
.- colour
character, progress bar colour.
- size
numeric, progress bar line size (line width).
- y_nudge
numeric, amount of vertical distance to move the progress bar (default: top of plot area).
- verbose
logical, if
TRUE
, messages and progress information are displayed on the console (default).
Examples
library(moveVis)
library(move2)
library(terra)
data("move_data", package = "moveVis")
r <- readRDS(example_data(file = "raster_NDVI.rds"))
# align movement
m <- align_move(move_data, res = units::set_units(4, "min"))
#> Temporal resolution of 4 [min] is used to align trajectories.
# create frames and add northarrow
frames <- frames_spatial(m, r, r_type = "gradient", fade_raster = TRUE) %>%
add_progress()
#> Processing input data...
#> Approximated animation duration: ≈ 7.52s at 25 fps using 188 frames
#> CRS (geodetic): WGS 84
#> Assigning raster maps to frames...
frames[[100]]
# or in white at another position
frames <- frames_spatial(m, r, r_type = "gradient", fade_raster = TRUE) %>%
add_progress(colour = "red", size = 2.5)
#> Processing input data...
#> Approximated animation duration: ≈ 7.52s at 25 fps using 188 frames
#> CRS (geodetic): WGS 84
#> Assigning raster maps to frames...
frames[[100]]