# For example, the minimum spanning tree of the input dataset "data" can be
# calculated with a leaf size of 20 and stored as "spanning_tree" using the
# following command:
if (FALSE) {
output <- emst(input=data, leaf_size=20)
spanning_tree <- output$output
}
# The output matrix is a three-dimensional matrix, where each row indicates
# an edge. The first dimension corresponds to the lesser index of the edge;
# the second dimension corresponds to the greater index of the edge; and the
# third column corresponds to the distance between the two points.
Run the code above in your browser using DataLab