I am trying to plot my study area in R. So far I have downloaded census OA boundary data and I have merged attribute data to the OA I wish to look at.
So lets say from a total of 1,000 OAs. I want to look at only 500 of these OAs, for which I have external dataset.
Land is my spatial polygons data frame containing the 1,000s OAs. It has one column which is the OA name "geocode". However, it has its coordinates because is you run:
coordinates(land)
it produces all the coordinates.
Houseprice is a data frame containing house prices and a column with the geocode.
Code for far:
library("sp")
library("GISTools")
library("maptools")
library("spatial")
library("ggplot2")
library("rgdal")
land@data = merge(land@data,houseprice,by.x="geocode",
by.y="geocode",sort=FALSE)
View(land)
this shows that I have only 500 entries (which is what I want).
plot(land)
this ends up plotting the whole 1,000 OAs instead of just the 500 I want.
What must I do for only the 500 OAs with data to just be plotted? Thanks for help