
Tools to visualize movement data in R
moveVis-package.Rd
moveVis
provides tools to visualize movement data (e.g. from GPS tracking) and temporal changes of environmental data (e.g. from remote sensing) by creating video animations.
The moveVis
package is closely connected to the move2
package and builds up on ggplot2
grammar of graphics.
Details
The package includes the following functions, sorted by the order they would be applied to create an animation from movement data:
Preparing movement tracks
align_move
aligns single and multi-individual movement data to a uniform time scale with a uniform temporal resolution needed for creating an animation from it. Use this function to prepare your movement data for animation depending on the temporal resolution that suits your data.
Creating frames
get_maptypes
returns available map services and types that can be used withframes_spatial
. This function is reexported from the <a href="https://jakob.schwalb-willmann.de/basemaps/">basemaps</a> package.frames_spatial
createsmoveVis
frames from movement and map/raster data, displaying movement-environment interactions spatio-temporally. Frames are returned as an object of classmoveVis
and can be subsetted, viewed (seerender_frame
), modified (seeadd_gg
and associated functions) and animated (seeanimate_frames
).frames_graph
createsmoveVis
frames displaying movement-environment interaction graphs. Frames can be viewed or modified individually and animated usinganimate_frames
.
Adapting frames
add_gg
addsggplot2
expressions (e.g. to add layers such as points, polygons, lines, or to change scales etc.) to frames created withframes_spatial
orframes_graph
.add_labels
adds character labels such as title or axis labels to frames created withframes_spatial
orframes_graph
.add_scalebar
adds a scalebar to frames created withframes_spatial
orframes_graph
.add_northarrow
adds a north arrow to frames created withframes_spatial
orframes_graph
.add_progress
adds a progress bar to frames created withframes_spatial
orframes_graph
.add_timestamps
adds timestamps to frames created withframes_spatial
orframes_graph
.add_text
adds static or dynamically changing text to frames created withframes_spatial
orframes_graph
.add_colourscale
adjusts the colour scales of frames created withframes_spatial
and custom map imagery.join_frames
side-by-side two or more sets of frames of equal lengths into one set of frames usingwrap_plots
, e.g. to combine spatial frames returned byframes_spatial
with graph frames returned byframes_graph
.get_frametimes
extracts the timestamps associated with each frame of frames created usingframes_spatial
orframes_graph
and returns them as a vector.
Animating frames (as GIF or video)
suggest_formats
returns a selection of suggested file formats that can be used without_file
ofanimate_frames
on your system.animate_frames
creates an animation frommoveVis
frames, e.g as.gif
or.mov
video file.
Viewing movement tracks
render_frame
renders an individual frame. It yields the same result as if an individual frame is extracted using[[]]
.view_spatial
displays movement tracks on an interactivemapview
orleaflet
map.
Methods
[.moveVis
extracts individual frames or a sequence of frames from amoveVis
frames object.[[.moveVis
renders an individual frame, likerender_frame
does.c
combines multiplemoveVis
frames.tail
andhead
returnn
last or first frames of amoveVis
frames object.length
returns the length ofmoveVis
frames, i.e. number of frames.print
shows basic information about amoveVis
frames object, i.e. number of frames, extent and more.rev
reverses the order of amoveVis
frames object.
Processing settings
use_multicore
enables multi-core usage for computational expensive processing steps.use_disk
enables the usage of disk space for creating frames, which can prevent memory overload when creating frames for very large animations.
Example data
move_data
, amove2
object representing coordinates and acquisition times of three simulated movement tracks, covering a location nearby Lake of Constance, Germany.whitestork_data
, adata.frame
and amove2
object, both representing coordinates and acquisition times of 15 White Storks, migrating from Lake of Constance, SW Germany, to Africa.example_data
, twoSpatRasterDataset
s, representing simulated NDVI images and an NDVI-derived classification covering the Lake of Constance area, as well as invented dates and times that simulate acquisition times.
The majority of these functions can be used with the forward pipe operator %>%
, which is re-exported by moveVis
.
See also
Useful links:
Report bugs at https://www.github.com/16eagle/moveVis/issues