Description Usage Arguments Details Value
Compute distances from each item to group centroids
1 | dist_to_centroids(d, g, squared = FALSE)
|
d |
A distance matrix object of class |
g |
A factor representing the groups of items in |
squared |
If |
This function computes the distance from each item to the centroid positions
of groups defined in the argument g
. This is accomplished without
determining the centroid positions directly; see the documentation for
dist_between_centroids
for details on this procedure.
If the distance can't be represented in a Euclidean space, the
CentroidDistance
is set to NaN
. See the documentation for
dist_between_centroids
for further details.
A data frame with distances to the group centroids:
A character vector of item labels from the dist object, or an integer vector of item locations if labels are not present.
The group for which the centroid distance is given. The column type
should match that of the argument g (the unique
function is used
to generate this column).
Inferred distance from the item to the centroid position of the indicated group.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.