ufp_batch_impute: Impute missing GPS data on multiple files

View source: R/batch_impute_coords.R

ufp_batch_imputeR Documentation

Impute missing GPS data on multiple files

Description

batch_impute_coords() imputes missing lon/lat coordinates that occur during GPS lapses by sampling event.

Usage

ufp_batch_impute(
  df,
  distance_threshold = 100,
  jitter_amount = 1e-05,
  show_lapse_distance = FALSE,
  fill_open_lapses = FALSE,
  speed_threshold = 5,
  speed_window = 60,
  open_lapse_length = 600
)

Arguments

df

an object created by ufp_batch_read().

distance_threshold

distance (meters) between the last known coordinates before a GPS lapse and the first known coordinates after a lapse are compared to this value. If the distance exceeds this threshold, coordinates are not imputed. Default = 100.

jitter_amount

numeric; amount of jitter to apply to imputed coords. Default = 0.00001 decimal degrees. See st_jitter.

show_lapse_distance

logical; If TRUE, a column will display the distance (meters) between the last known coordinate before a GPS lapse and first known coordinate after a GPS lapse. Default = FALSE.

fill_open_lapses

logical; impute missing coordinates at the beginning and end of the data frame (i.e. lapses not enclosed by known coordinates). Default = FALSE.

speed_threshold

criteria to impute open lapses. If the median speed of cooridnates before or after an open lapse exceeds this threshold, coordinates are not imputed. Default = 5 (m/s).

speed_window

numeric; number of rows used to calculate "speed_threshold."

open_lapse_length

if the number of rows in an open lapse exceed this threshold, coordinates are not imputed. Default = 600.

Value

a data frame. A column is created to indicate whehter coordinates were imputed ('imputed_coord'). The function also creates an additional column stating the distance between lapses ('lapse_distance').

Examples

## Not run: 

ufp_batch_impute(df,
  distance_threshold = 100, jitter_amount = 0.00001, show_lapse_distance = FALSE,
  fill_open_lapses = FALSE, speed_threshold = 5, speed_window = 60,
  open_lapse_length = 600
)

## End(Not run)

wolfeclw/pufpR documentation built on April 2, 2022, 9:48 a.m.