# this example describes a set of three data points (indexes 1,2,3)
# which are equidistant from each other. Hence the distance between
# pairs (i, j) is 0 for i=j and 1 otherwise.
three.indexes = matrix(c(1,2,3,
2,1,3,
3,1,2), nrow=3, ncol=3)
three.distances = matrix(c(0, 1, 1,
0, 1, 1,
0, 1, 1), nrow=3, ncol=3)
umap.knn(three.indexes, three.distances)
Run the code above in your browser using DataLab