I'm trying to create SpatialPoints objetcs from data frame on R

natFPV <- SpatialPointsDataFrame(coords = coordinates(natFPv.per_data[,c(27,28)]),data = natFPv.per_data[,-c(27,28)])
natFPV <- SpatialPoints(coords = coordinates(natFPv.per_data[,c(27,28)]))

But getting the error for both:

Warning: Error in SpatialPoints: could not find function "SpatialPoints"

I'm really don't konw how to deal it.

  • Have you imported the library with library(sp)?
    – BERA
    Oct 18, 2017 at 11:23

1 Answer 1


You need to load the library with:


You need to do this once in each session, unless you customize your environment to automatically load it each time

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.