Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201945

how to assign locations as cluster centroids and run clustering to find the nearest points to each centroid?

$
0
0

use the centroid coordinates as centroids and cluster the rest of the locations around them as per the nearest one.

Centroid <- data.frame (longitude  =c( -1.482880, -1.485735),
                            latitude = c( 54.89935, 54.89935),
                            ID = c(1,2,3,4,5))

Locations <- data.frame(longitude = c(-1.482156, -1.482318, -1.482129, -1.484275, -1.485866), 
                           latitude= c(54.90083, 54.90078, 54.90077, 54.90011, 54.89936),
                           ID = c(A,B,C,D,E))

Viewing all articles
Browse latest Browse all 201945

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>