Learn R Programming

shotGroups (version 0.1)

getDistToCtr: Distances to center for a set of points

Description

Calculates the respective distances for a set of points to their center.

Usage

getDistToCtr(xy)

Arguments

xy
a numerical (n x p)-matrix with the coordinates of n points in p-dimensional space (1 row of coordinates per point).

Value

  • A numerical vector with the distances from each point to the center of the set.

Examples

Run this code
xy <- matrix(round(rnorm(20, 100, 15), 1), ncol=2)
getDistToCtr(xy)

Run the code above in your browser using DataLab