missing_data: Find Missing Data in a Track Table

View source: R/errors.R

missing_dataR Documentation

Find Missing Data in a Track Table

Description

This function attempts to automatically detect missing data (for instance due to writing errors) in track tables.

Usage

missing_data(x, begin = NULL, end = NULL, step = NULL)

Arguments

x

A track table as produced by the track function.

begin

A full time stamp (date+time) in POSIXct format corresponding to the time from which the missing data should be looked for. If not set, the first time stamp of the track table will be used.

end

A full time stamp (date+time) in POSIXct format corresponding to the time until which the missing data should be looked for. If not set, the last time stamp of the track table will be used.

step

A difftime object representing the expected time between two consecutive locations of the trajectory. If not set, it is set to the most common time difference between successive locations in x.

Value

A track table of all observations with missing data. The missing data is indicated with NA.

Author(s)

Simon Garnier, garnier@njit.edu

See Also

track

Examples

# Create data set with missing time stamps
data(short_tracks)
t_df <- track(x = short_tracks$x, y = short_tracks$y, t = short_tracks$t,
              id = short_tracks$id, proj = "+proj=longlat",
              tz = "Africa/Windhoek", table = "df")
t_df <- t_df[-c(10, 100), ]

# Find missing data
missing <- missing_data(t_df)


swarm-lab/trackdf documentation built on March 27, 2023, 2:13 a.m.