atl_median_smooth: Apply a median smooth to coordinates.

Description Usage Arguments Value Examples

View source: R/fun_smooth_data.R

Description

Applies a median smooth defined by a rolling window to the X and Y coordinates of the data. This function modifies in place, i.e., the results need not be assigned to a new data.table.

Usage

1
atl_median_smooth(data, x = "X", y = "Y", time = "TIME", moving_window = 3)

Arguments

data

A dataframe object returned by getData. Must contain the columns "X", "Y", "SD", "NBS", "TAG", "TIME"; these are the X coordinate, Y coordinate, standard deviation in measurement, number of ATLAS towers that received the signal, the tag number, and the numeric time, in milliseconds from 1970-01-01.

x

The X coordinate.

y

The Y coordinate.

time

The timestamp, ideally as an integer. median calculation.

moving_window

The size of the moving window for the median smooth. Must be an odd number.

Value

A datatable class object (extends data.frame) which has the additional columns posID and ts, which is TIME converted to human readable POSIXct format.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
atl_median_smooth(
  data = track_data,
  x = "x", y = "y",
  time = "time",
  moving_window = 5
)

## End(Not run)

pratikunterwegs/atlastools documentation built on Nov. 7, 2021, 7:14 p.m.