Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. library(rgdal)
  2. ldnwards <- readOGR("LDN_wards.shp", "LDN_wards")
  3. library(dplyr)
  4. le10cen11$CODE <- le10cen11$ward.code
  5. ldnwards@data <- left_join(le10cen11, ldnwards@data, by=c("CODE"), copy=TRUE)
  6. ldm_f <- fortify(ldnwards@data, region="CODE")
  7. ldm_f <- left_join(ldm_f, ldnwards@data)
  8. names(ldm_f) # i think the problem is revealed here, there are no variables here that allow ggplot to visualise i.e. that could be used as x= and y= arguments such as long/lat or 'Easting' and 'Northing'
  9.  
  10. map <- ggplot(ldm_f, aes(fill = ldnwards$turnout) +
  11. geom_polygon() +
  12. coord_equal() +
  13. labs(x = "Easting (m)", y = "Northing (m)",
  14. fill = "ldm_f$turnout") +
  15. ggtitle("London Turnout by Ward")
  16.  
  17. map
  18.  
  19. Error: unexpected symbol in:
  20. "
  21. map"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement