Advertisement
LrdArc

Untitled

Dec 20th, 2016
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. > presentase <- queryResults_filtered
  2. > presentase$Provinsi <- NULL
  3. > presentase$terjangkit <- NULL
  4. > presentase$Longitude <- NULL
  5. > presentase$Latitude <- NULL
  6.  
  7. > presentase$PDRB_per_kapita_2014_juta_rupiah <- NULL
  8. > presentase$Populasi_Proyeksi_BPS_2014 <- NULL
  9. > results <- kmeans( presentase, 3 )
  10. > presentase$cluster <- results$cluster
  11. > View(queryResults_filtered)
  12. > View(queryResults_filtered)
  13. > View(queryResults_filtered)
  14. > View(queryResults_filtered)
  15. > View(presentase)
  16. > pers_penyakit = data.frame( presentase$cluster, queryResults_filtered$Latitude, queryResults_filtered$Longitude )
  17. > colnames( pers_penyakit ) = c( 'cluster', 'lat', 'long' )
  18. > library(ggmap)
  19. Loading required package: ggplot2
  20. Google Maps API Terms of Service: http://developers.google.com/maps/terms.
  21. Please cite ggmap if you use it: see citation('ggmap') for details.
  22. > mapzoom = OSM_scale_lookup(zoom = 6)
  23. > indoMap = ggmap(get_openstreetmap(bbox = c(left = 94.328, bottom = -13.795, right = 140.977, top = 12.426), scale = mapzoom), extent="normal")
  24. indoMap +
  25. geom_point(aes(x=long, y=lat, color=factor(cluster)), data=pers_penyakit, alpha=0.4, size=4) +
  26. scale_colour_manual(values = c("yellow","red", "blue"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement