Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > presentase <- queryResults_filtered
- > presentase$Provinsi <- NULL
- > presentase$terjangkit <- NULL
- > presentase$Longitude <- NULL
- > presentase$Latitude <- NULL
- > presentase$PDRB_per_kapita_2014_juta_rupiah <- NULL
- > presentase$Populasi_Proyeksi_BPS_2014 <- NULL
- > results <- kmeans( presentase, 3 )
- > presentase$cluster <- results$cluster
- > View(queryResults_filtered)
- > View(queryResults_filtered)
- > View(queryResults_filtered)
- > View(queryResults_filtered)
- > View(presentase)
- > pers_penyakit = data.frame( presentase$cluster, queryResults_filtered$Latitude, queryResults_filtered$Longitude )
- > colnames( pers_penyakit ) = c( 'cluster', 'lat', 'long' )
- > library(ggmap)
- Loading required package: ggplot2
- Google Maps API Terms of Service: http://developers.google.com/maps/terms.
- Please cite ggmap if you use it: see citation('ggmap') for details.
- > mapzoom = OSM_scale_lookup(zoom = 6)
- > indoMap = ggmap(get_openstreetmap(bbox = c(left = 94.328, bottom = -13.795, right = 140.977, top = 12.426), scale = mapzoom), extent="normal")
- indoMap +
- geom_point(aes(x=long, y=lat, color=factor(cluster)), data=pers_penyakit, alpha=0.4, size=4) +
- scale_colour_manual(values = c("yellow","red", "blue"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement