mergeTrackStop: Merge a location data set with a dry time (or other stopping)...

mergeTrackStopR Documentation

Merge a location data set with a dry time (or other stopping) covariate

Description

The function merges a location data set with a stopping variable data set.

Usage

mergeTrackStop(
  data,
  stopData,
  Time.name = "Time",
  interp = c("zeros", "ma0"),
  win = 2,
  constCol
)

Arguments

data

Location data.

stopData

stopping variable data set.

Time.name

character naming time index variable in both data sets

interp

method of interpolation.

win

window for "ma0" interpolation method.

constCol

columns in data for which the user would like to be constant, such as id or sex.

Details

Simply merges the data frames and interpolates based on the chosen method. Both data frames have to use the same name for the time variable. Also contains stopType which = "o" if observed or "p" for interpolated.

The merged data is truncated to the first and last time in the location data set. Missing values in the stopping variable data set can be interpolated by replacing them with zeros (full movement) or first replacing with zeros then using a moving average to smooth the data. Only the missing values are then replace with this smoothed data. This allows a smooth transition to full movement.

Value

Merged data.frame with new column from stopData. Missing values in the stopping variable will be interpolated

Author(s)

Devin S. Johnson

Examples



track <- data.frame(TimeVar=sort(runif(20,0,20)), x=1:20, y=20:1)
track
stopData <- data.frame(TimeVar=0:29, stopVar=round(runif(30)))
stopData
mergeTrackStop(track, stopData, Time.name="TimeVar")


NMML/crawl documentation built on Nov. 1, 2022, 5:27 p.m.