View source: R/distance.info.function.R

distance.info | R Documentation |

A range of descriptive statistics on the distribution of the pairwise distances between observations.

```
distance.info(data)
```

`data` |
A data frame or matrix containing the x-coordinates in the first column and the y-coordinates in the second column. Additional columns are ignored. |

A list containing:

`distmatrix` |
A matrix containing the pairwise Euclidean distances between all given locations. |

`distset` |
A vector containing the pairwise Euclidean distances.
The elements equal the upper (or lower) triangle minus the diagonal
of the distance matrix. If the input dataset has n rows, |

`distsummary` |
A summary containing the minimum, 1st quartile, median, mean,
3rd quartile and maximum of the |

`maxdist` |
The maximal distance. |

Moreover, the function prints a histogram of the pairwise distances saved in the list entry `distset`

.

```
## Example 1
x = c(1,3,7,10,15)
y = c(5,19,8,3,11)
z = rnorm(5, mean = 20, sd = 40)
dataset = as.data.frame(cbind(x,y,z))
distance.info(data = dataset)
## Example 2
distance.info(birth)
```

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.