getDistToCtr | R Documentation |
Calculates the distances of a set of points to their center.
getDistToCtr(xy) ## S3 method for class 'data.frame' getDistToCtr(xy) ## Default S3 method: getDistToCtr(xy)
xy |
either a numerical (n x p)-matrix with the coordinates of n points in p-dimensional space (1 row of coordinates per point), or a data frame with either the variables |
A numerical vector with the distances from each point to the center of the set.
# coordinates given by a suitable data frame getDistToCtr(DFtalon) # coordinates given by a matrix ## Not run: xy <- matrix(round(rnorm(20, 100, 15), 1), ncol=2) getDistToCtr(xy) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.