Learn R Programming

trackdf (version 0.3.3)

missing_data: 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)

Value

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

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.

Author

Simon Garnier, garnier@njit.edu

See Also

track

Examples

Run this code
# 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)

Run the code above in your browser using DataLab