Calculate nearest-neighbour distances
calcNNdists(obj, nnn = 1, act = FALSE)
# S3 method for arcosTS
calcNNdists(obj, nnn = 1, act = FALSE)
an arcosTS object.
an integer, sets the n-th nearest neighbour; default 1.
logical, if TRUE, the NN distance is calculated only on active objects, i.e. those with binarised measurement not smaller than 1; default FALSE.
a data.table
Wrapper for the calcVecNNdists
function.
library(ARCOS)
library(data.table)
ts = data.table(frame = c(1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5),
objid = c(1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 4, 1, 4),
x = c(1, 3, 1.2, 2.5, 3.5, 0.9, 2.6, 2.9, 3.2, 1.1, 2.8, 3.1, 1, 3))
arcosTS(ts,
colPos = "x",
col = list(Frame = "frame",
IDobj = "objid",
RT = NULL,
IDcoll = NULL),
interVal = 1.,
interType = "fixed")
#> Error in arcosTS(ts, colPos = "x", col = list(Frame = "frame", IDobj = "objid", RT = NULL, IDcoll = NULL), interVal = 1, interType = "fixed"): argument 3 matches multiple formal arguments
nnDists = calcNNdists(ts)
#> Error in UseMethod("calcNNdists"): no applicable method for 'calcNNdists' applied to an object of class "c('data.table', 'data.frame')"