Description Usage Arguments Details Value References Examples

View source: R/MSTDist_FromMat.R

Calculates the minimum spanning tree distance, in kilometers, using Prim's Algorithm [1] and a previously calculated pairwsie distance matrix

1 | ```
MSTDist_FromMat(longs, lats, DistMat)
``` |

`longs` |
- Longitudinal occurrences in decimal degrees |

`lats` |
- Latitudinal occurrences in decimal degrees |

`DistMat` |
- Pairwsie distance matrix of coordinates, from the PWMatrix() function |

Uses Prim's algorithm for finding the minimum spanning tree

Returns the minimum spanning tree distance in kilometers, the pairwise distance matrix of occurrences, the order points were connected in, and a 2-column array of coordinates

[1] Prim, R.C. 1957. Shortest Connection Networks and Some Generalizations. The Bell System Technical Journal 36:1389-1401.

1 2 | ```
MSTCalc<-MSTDist(longs=c(22,44,-12,67),lats=c(-77,56,22,56))
MSTDist_FromMat(MSTCalc$Longitude,MSTCalc$Latitude,MSTCalc$MST_DistMat)
``` |

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.