Tracking Data.

Access and manipulate spatial tracking data, with straightforward coercion from and to other formats. Filter for speed and create time spent maps from tracking data. There are coercion methods to convert between 'trip' and 'ltraj' from 'adehabitatLT', and between 'trip' and 'psp' and 'ppp' from 'spatstat'. Trip objects can be created from raw or grouped data frames, and from types in the 'sp', sf', 'amt', 'trackeR', 'mousetrap', and other packages, Sumner, MD (2011) <>.

R buildstatus R-CMD-check CRANstatus CRAN_Download_Badge

Tools for animal track data

The trip package provides facilities to access and manipulate spatial-temporal data organized for tracking movements. Data with locations, date-times, and grouping IDs for trips are formally declared using the trip() function and enables easy calculation of step distance and angle and grouped summaries of trip duration and length.

Conversion from and to many disparate formats is a key focus, and data may be treated as points-in-time or as line segments with a start/end time property. There are functions for simple speed-distance-angle filtering determining time-spent in area and creating line or point plots with standard R spatial tools and graphics.

Reading data

Track data may be read from various Argos formats with readArgos() or readDiag(), from generic data frame or spatial- data frames, and many types of objects from other tracking packages are supported.

Converting data

Trip objects can be imported directly from types defined in packages adehabitatLT, amt, ctmm, eyetrackeRdata, mousetrap, sf, and sp. When these formats do not have time or trip-grouping values they may be declared by name. A generic data frame may be converted to trip by organizing the x, y, time, ID columns in order, or by a combination of row grouping with x, y, time columns. All other data are retained in the obvious way.

Trip objects can be used to create other data types defined by adehabitatLT, amt, sf, sp, spatstat, and this is possible for conversion to point types or line types. For example, as(trip, "SpatialLinesDataFrame") creates a single multi-line for each trip, with start and end time properties. The explode(trip) function breaks a trip into individual line segments for every pair of coordinates, and as(trip, "SpatialPointsDataFrame") will create a standard sp points data frame. There are similar facilities for sf types, and for the spatstat types point pattern as.ppp(trip) or line segments as.psp(trip).

Trips can be exported to Google Earth and explored using the continuous time slider with the write_track_kml() function.

Validating data

The trip() function performs a significant series of data validation, to ensure that basic sense prevails. The function will always proceed to give a valid trip object, and simply warn about which problems had to be overcome. These validation checks can be used to discover what is wrong with a particular set of data, and in time we hope this to become much more powerful and transparent.

Transforming and merging data

Trip objects can be reproject directly with the spTransform function in the usual way, and functions that are coordinate system aware such as raster::extract will automatically reproject the coordinates behind the scenes. We are developing more sophisticated point-in-time data extraction routines and auto-reprojecting map plotting functions in related projects.

Simple data filtering and time-spent gridding

Some simple data summary methods have gone out of favour or been ignored, and trip provides direct access to the speedfilter(), sda() and rasterize() functions for straightforward data filtering on maximum speed, minimum angle/distance, and time-spent-in-area gridding.

There is a homedist() function to calculate the maximum distance from each trip’s starting point, and various old-school functions. Some of these will be improved and better exposed in time.

See vignette("trip") for more.

Let us know what you think via Issues.


The package is easily installed from CRAN in R.


Install dev version

To install the development package from Github:



  • we should start again with the wk package
  • trip should work with sf or sp, there’s really no need to distinguish these
  • ability to treat all line segments as continuous, as cut.trip can for rasterizing, possibly needs a second-level ID grouping
  • separate out reading functionality to rgos
  • separate out algorithm functions into a generic package that other tracking packages could use (distance, speed, angle filtering, rasterizing, time spent, interpolation etc.)
  • Better summary tools, the SGAT (and tripEstimation) packages have functions for dealing with spatial track summaries that are atomized to the level of each time step.
  • More conversion tools between formats
  • Validation must include a detailed report object of where the problems are, and how to filter/fix/flush them.

Trip would be better implemented on top of the ideas in the silicate package, rather than the twilight zone between MULTIPOINTs and LINESTRINGs as it is now. Since this was first written we now have some good spatial development packages in wk, geos, vapour, and traipse. At some point this will good a decent revisit.

Please me know what you think via Issues.

Code of Conduct

Please note that the trip project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.






Platforms (71)

    FreeBSD 13
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd13
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows