- a
A vector or matrix. If a vector, b must also be provided. If a matrix and b
is missing, each row will be compared. If a matrix and b is not missing, each row will
be compared with b or each row of b.
- b
A vector or matrix to be compared with a or rows of a.
- metric
A character or vector of characters at least partially matching one of the
available metric names (or 'all' to explicitly include all metrics),
or a number or vector of numbers indicating the metric by index:
jaccard: sum(a & b) / sum(a | b)
euclidean: 1 / (1 + sqrt(sum((a - b) ^ 2)))
canberra: mean(1 - abs(a - b) / (a + b))
cosine: sum(a * b) / sqrt(sum(a ^ 2 * sum(b ^ 2)))
pearson: (mean(a * b) - (mean(a) * mean(b))) /
sqrt(mean(a ^ 2) - mean(a) ^ 2) / sqrt(mean(b ^ 2) - mean(b) ^ 2)
- group
If b is missing and a has multiple rows, this will be used to make
comparisons between rows of a, as modified by agg and agg.mean.
- lag
Amount to adjust the b index; either rows if b has multiple rows (e.g.,
for lag = 1, a[1, ] is compared with b[2, ]), or values otherwise (e.g.,
for lag = 1, a[1] is compared with b[2]). If b is not supplied,
b is a copy of a, resulting in lagged self-comparisons or autocorrelations.
- agg
Logical: if FALSE, only the boundary rows between groups will be compared, see
example.
- agg.mean
Logical: if FALSE aggregated rows are summed instead of averaged.
- pairwise
Logical: if FALSE and a and b are matrices with the same number of
rows, only paired rows are compared. Otherwise (and if only a is supplied), all pairwise
comparisons are made.
- symmetrical
Logical: if TRUE and pairwise comparisons between a rows were made,
the results in the lower triangle are copied to the upper triangle.
- mean
Logical: if TRUE, a single mean for each metric is returned per row of a.
- return.list
Logical: if TRUE, a list-like object will always be returned, with an entry
for each metric, even when only one metric is requested.