O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

In step 1, the sp package is loaded.

In step 2, the data file is read, showing that nj is now a regular data frame object.

In step 3, the Lat and Long variables are identified from the nj data frame as spatial coordinates through the coordinates function. We see that nj has now been transformed into a SpatialPointsDataFrame object--a full-fledged spatial object.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required