Learn R Programming

nbpMatching (version 1.5.6)

scalar.dist: Calculate scalar distance

Description

Calculate the scalar distance between elements of a matrix.

Usage

scalar.dist(x, ...)

Value

a matrix object

Arguments

x

A vector of numeric values.

...

Additional arguments, not used at this time.

Author

Jake Bowers, http://www.jakebowers.org/, Cole Beck

Details

Take the absolute difference between all elements in a vector, and return a matrix of the distances.

Examples

Run this code

scalar.dist(1:10)

Run the code above in your browser using DataLab