The data set of shapefile "Property1A" is:
df
# suburb area asst
# 0 Te Aro 14.541780 R076
# 1 Te Aro 7.655428 R076
# 2 Te Aro 3189.976134 <NA>
# 3 Te Aro 242.173386 0132
# 4 Karori 537.697290 R003
# 5 Pipitea 1116.954993 R105
# 6 Mt Cook 106.099900 R151
# 7 Te Aro 83.307421 R057
# 8 Aro Valley 544.665788 R105
# 9 Aro Valley 59.726882 R110
When I try to subset the shapefile for suburb "Te Aro", the code I use is:
TeAro <- subset(Property1A, suburb == "Te Aro")
But there is an error:
TeAro <- subset(Property1A, suburb == "Te Aro")
# Error in eval(expr, envir, enclos) : object 'suburb' not found
Why there is an error?
See Question&Answers more detail:os