November 2016
Beginner to intermediate
959 pages
43h 46m
English
This recipe shows how you can add variables to spatial data frame objects. One approach (see the recipe Creating spatial data frames by combining regular data frames with spatial objects, earlier in this chapter) will be to create all the necessary variables before creating the spatial data frame object. However, this might not always be feasible. This recipe shows how you can add nonspatial variables to an existing spatial data frame object.
Install the sp, maps, and maptools packages. Download and place the nj-county-data.csv file in your R working directory.
To add variables to an existing spatial data frame, follow these steps:
Read now
Unlock full access