[.dist {distops} | R Documentation |
Distance Matrix Subset Operator
Description
Subset operator for the distance matrix stored as an object of
class stats::dist
.
Usage
## S3 method for class 'dist'
x[i, j, drop = TRUE, ...]
Arguments
x |
An object of class |
i |
An integer vector of row indices. Values must be either all positive in which case they indicate the rows to select, or all negative in which case they indicate the rows to omit. |
j |
An integer vector of column indices. Values must be either all positive in which case they indicate the columns to select, or all negative in which case they indicate the columns to omit. |
drop |
A logical value indicating whether the result should be coerced to a vector or matrix if possible. |
... |
Additional arguments passed to |
Value
A numeric matrix storing the pairwise distances between the requested observations.
Examples
D <- stats::dist(iris[, 1:4])
D[2:3, 7:12]
[Package distops version 0.1.0 Index]