Description Usage Arguments Details Value Methods (by class) Special cases Column specification
Generic function that, given a set of pionts,
finds distances between them and their centroid.
Calls centroid
and euclidean
.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x |
numeric vector, matrix or data frame |
... |
for data frame method, columns that store cooridinates |
A set of coordinates in n-dimensional space can be provided as a matrix or a data frame
with points listed in rows and dimensions listed in columns (see Column specification
).
First the centroid coordinates is found by centroid
and then the point-centroid distances are computed by euclidean
.
numeric vector of distances
numeric
: returns deviations from the mean
matrix
: finds the centroid and applies the catresian
function across the matrix rows;
if x
only has one column, drops dimensions and calls vector method
data.frame
: extracts the requested columns and converts them to a matrix and then calls the matrix method
grouped_df
: see data.frame__to__grouped_df
For a 1-dimensional set (one column matrix) deviations from the mean are returned.
For a single point (one row matrix) expect Value
to be 0.
Any missing coordinates (NAs) will derail distance calculation for that point.
Matrices are accepted as is, all columns are considered.
If x
is a data frame, columns that carry coordinates may be specified.
They can be given as strings, bare names or numerical indices but
they must all be specified in the same way.
Also, each column must be specified separately, vectors are not accepted.
If no columns are specified, all numeric ones are considered.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.