library(sp) sdf <- SpatialPointsDataFrame(df3[,c("lon","lat")],df3)