animate_movement_vectors()
produces a gganim
object in which each frame
is a map of vectors showing the average modeled movement for all birds from
each cell in the landscape at a given timestep. It is analogous to a series
of images created with plot_movement_vectors()
.
Arguments
- bf
A BirdFlow object
- ...
Arguments passed on to
lookup_timestep_sequence
season
a season name, season alias, or "all". See
lookup_season_timesteps()
for options.start
The starting point in time specified as a timestep, character date, or date object.
end
The ending point in time as a date or timestep.
direction
Either "forward" or "backward" defaults to
"forward"
if not processing dates. If using date inputdirection
is optional and is only used to verify the direction implicit in the dates.season_buffer
Only used with
season
input.season_buffer
is passed tolookup_season_timesteps()
and defaults to 1; it is the number of timesteps to extend the season by at each end.n_steps
Alternative to
end
The end will ben_steps
away fromstart
indirection
; and the resulting sequence will haven_step
transitions andn_steps + 1
timesteps.
Value
A gganim
object. print()
will plot it with default
options, or use animate()
to set the options. See the example for
recommended settings.
Details
Each arrow represents the average of all the transitions from a single cell. The tail of the arrow is the center of that cell, the head is the average location at the following timestep for birds that start at that cell.
The timestep and/or date label is the starting timestep for the transition that is displayed and the format depends on birdflow_options("time_format")
Thicker lines and less transparency (darker shading) indicate higher density in the eBird S&T distribution for the beginning timestep of the displayed transition.
Use the "ragg_png" device when rendering animations as in the example code.
Examples
bf <- BirdFlowModels::amewoo
a <- animate_movement_vectors(bf)
#> Creating vector fields
#> ....................................................
if (FALSE) { # \dontrun{
# Animate, display, and save
# Note: "ragg_png" is considerably faster and produces cleaner output than
# the default device.
gif <- gganimate::animate(a, fps = 1, device = "ragg_png",
width = 6, height = 5,
res = 150, units = "in")
print(gif)
# Save
gif_file <- tempfile("animation", fileext = ".gif")
gganimate::save_animation(gif, gif_file)
file.remove(gif_file) # cleanup
} # }