Description Usage Arguments Value Author(s) Examples

View source: R/similarityMeasures.R

A function to check whether two points lie within some distance in every dimension.

1 | ```
DistanceCheck(point1, point2, dist, dimensions=length(point1))
``` |

`point1` |
An n dimensional vector representing point1. |

`point2` |
An n dimensional vector representing point2. |

`dist` |
A floating point number representing the maximum distance in each dimension allowed for points to be considered equivalent. |

`dimensions` |
An integer representing the number of dimensions being checked. This defaults to the length of the first vector. |

A boolean value is returned. The value is true if the points are within the distance in every dimension and false if not.

Kevin Toohey

1 2 3 4 5 6 7 | ```
# Creating two points.
point1 <- c(0, 2, 4, 6)
point2 <- c(0, 1, 2, 3)
# Running the check with distances 1 and 3 in 4 dimensions.
DistanceCheck(point1, point2, 1, 4)
DistanceCheck(point1, point2, 3, 4)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.