
Tools to visualize movement data in R
moveVis-package.RdmoveVis 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_movealigns 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_maptypesreturns 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_spatialcreatesmoveVisframes from movement and map/raster data, displaying movement-environment interactions spatio-temporally. Frames are returned as an object of classmoveVisand can be subsetted, viewed (seerender_frame), modified (seeadd_ggand associated functions) and animated (seeanimate_frames).frames_graphcreatesmoveVisframes displaying movement-environment interaction graphs. Frames can be viewed or modified individually and animated usinganimate_frames.
Adapting frames
add_ggaddsggplot2expressions (e.g. to add layers such as points, polygons, lines, or to change scales etc.) to frames created withframes_spatialorframes_graph.add_labelsadds character labels such as title or axis labels to frames created withframes_spatialorframes_graph.add_scalebaradds a scalebar to frames created withframes_spatialorframes_graph.add_northarrowadds a north arrow to frames created withframes_spatialorframes_graph.add_progressadds a progress bar to frames created withframes_spatialorframes_graph.add_timestampsadds timestamps to frames created withframes_spatialorframes_graph.add_textadds static or dynamically changing text to frames created withframes_spatialorframes_graph.add_colourscaleadjusts the colour scales of frames created withframes_spatialand custom map imagery.join_framesside-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_spatialwith graph frames returned byframes_graph.get_frametimesextracts the timestamps associated with each frame of frames created usingframes_spatialorframes_graphand returns them as a vector.
Animating frames (as GIF or video)
suggest_formatsreturns a selection of suggested file formats that can be used without_fileofanimate_frameson your system.animate_framescreates an animation frommoveVisframes, e.g as.gifor.movvideo file.
Viewing movement tracks
render_framerenders an individual frame. It yields the same result as if an individual frame is extracted using[[]].view_spatialdisplays movement tracks on an interactivemapvieworleafletmap.
Methods
[.moveVisextracts individual frames or a sequence of frames from amoveVisframes object.[[.moveVisrenders an individual frame, likerender_framedoes.ccombines multiplemoveVisframes.tailandheadreturnnlast or first frames of amoveVisframes object.lengthreturns the length ofmoveVisframes, i.e. number of frames.printshows basic information about amoveVisframes object, i.e. number of frames, extent and more.revreverses the order of amoveVisframes object.
Processing settings
use_multicoreenables multi-core usage for computational expensive processing steps.use_diskenables the usage of disk space for creating frames, which can prevent memory overload when creating frames for very large animations.
Example data
move_data, amove2object representing coordinates and acquisition times of three simulated movement tracks, covering a location nearby Lake of Constance, Germany.whitestork_data, adata.frameand amove2object, both representing coordinates and acquisition times of 15 White Storks, migrating from Lake of Constance, SW Germany, to Africa.example_data, twoSpatRasterDatasets, 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