Learn R Programming

foieGras (version 0.7-6)

prefilter: Prepare Argos data for fitting state-space model

Description

prefilter (1) determines Argos data type (LS or KF); (2) converts dates to POSIXt & identifies observations with duplicate dates; (3) orders observations in time; (4) removes duplicate observations; (5) removes observations occurring within 60 s of one another (keeps first); (6) shifts longitudes that straddle -180,180 to 0,360 and vice-versa; (7) projects lonlat coords to mercator x,y coords (in km); (8) adds location error multiplication factors based on Argos location class (for type LS); (9) uses a trip::sda to identify potential outlier locations. trip::sda is a fast, vectorized version of argosfilter::sdafilter see ?argosfilter::sdafilter for details on implementation

Usage

prefilter(
  data,
  vmax = 5,
  ang = c(15, 25),
  distlim = c(2500, 5000),
  spdf = TRUE,
  min.dt = 60,
  emf = NULL
)

Arguments

data

input data, must have 5 (LS), or 8 (KF) columns (see details)

vmax

max travel rate (m/s)

ang

angles of outlier location "spikes" (default is c(15,25) deg); ang = NA turns off trip::sda filter in favour of trip::speedfilter

distlim

lengths of outlier location "spikes" (default is c(2500, 5000) m); distlim = NA turns off trip::sda filter in favour of trip::speedfilter. Either ang = NA or distlim = NA are sufficient.

spdf

turn speed filter on/off (logical; default is TRUE)

min.dt

minimum allowable time difference in s between observations; dt < min.dt will be ignored by the SSM

emf

optionally supplied data.frame of error multiplication factors for Argos location quality classes. see Details

Value

an sf object with all observations passed from data and the following appended columns

keep

logical indicating whether observation should be ignored by sfilter (FALSE)

obs.type

flag indicating whether KF or LS measurement model applies

emf_x

error multiplication factors for x direction

emf_y

error multiplication factors for y direction

geometry

sf POINT object giving x,y coordinates in km

Details

called by fit_ssm.