The DT must be a data.table. If your data is a
data.frame, you can convert it by reference using
data.table::setDT.
The id, coords timegroup (and optional splitBy)
arguments expect the names of a column in DT which correspond to the
individual identifier, X and Y coordinates, timegroup (generated by
group_times) and additional grouping columns.
If provided, the threshold must be provided in the units of the coordinates and must be larger than 0.
If the threshold is NULL, the distance to all other individuals will be returned. The coordinates must be planar
coordinates (e.g.: UTM). In the case of UTM, a threshold = 50 would
indicate a 50m distance threshold.
The timegroup argument is required to define the temporal groups
within which edges are calculated. The intended framework is to group rows
temporally with group_times then spatially with edge_dist.
If you have already calculated temporal groups without
group_times, you can pass this column to the timegroup
argument. Note that the expectation is that each individual will be observed
only once per timegroup. Caution that accidentally including huge numbers of
rows within timegroups can overload your machine since all pairwise distances
are calculated within each timegroup.
The splitBy argument offers further control over grouping. If within
your DT, you have multiple populations, subgroups or other distinct
parts, you can provide the name of the column which identifies them to
splitBy. edge_dist will only consider rows within each
splitBy subgroup.