impute_coords.Rd
impute_coords()
imputes missing lon/lat coordinates that occur during GPS lapses.
impute_coords(
df,
dt_field = NULL,
distance_threshold = 100,
jitter_amount = 5e-05,
show_lapse_distance = FALSE,
fill_open_lapses = FALSE,
speed_threshold = NULL,
speed_window = NULL,
open_lapse_length = NULL
)
data frame containing latitude (lat
) and longitude (lon
)
character; name of datetime field.
numeric; distance (meters) between the last known coordinates before GPS signal loss and the first known coordinates following signal loss are compared to this value. If the distance exceeds this threshold, coordinates are not imputed. Default = 100 meters.
numeric; amount of jitter to apply to imputed coords.
Default = 0.00005 decimal degrees. See st_jitter
.
logical; if TRUE
, a column will be added to the output data frame
listing the distance between the last and first know coordinates for each lapse in
GPS signal. Default = FALSE
.
logical; if TRUE
,missing coordinates at the
beginning and end of the data frame are imputed (i.e. lapses not enclosed by known
coordinates). Default = FALSE
.
numeric; criteria to impute open lapses. If the median speed (m/s) of coordinates before or after an open lapse exceeds this threshold, coordinates are not imputed.
numeric; number of rows used to calculate speed_threshold
.
numeric; if the number of rows in an open lapse exceed this threshold, coordinates are not imputed.
a data frame. An additional column is created to indicate whether coordinates were imputed ('imputed_coord').
if (FALSE) {
impute_coords(df,
distance_threshold = 100, jitter_amount = 0.00001, fill_open_lapses = FALSE,
speed_threshold = NULL, speed_window = NULL, open_lapse_length = NULL
)
}