Hi Community,
Im want make a KML file with one excel data. I have problem in the final step when I try to save the KML file. The points was show wrong. Some rows are NA in the data.
This points are of South America, Colombia.
library(ggmap)
library(maptools)
library(rgdal)
library(readxl)
library(sp)
library(sf)
coordinates(data4)<-c("LATITUD","LONGITUD")
proj4string(data4)<-CRS("+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6378140 +b=6356750 +units=m +no_defs")
writeOGR(data4, dsn="Productores.kml", layer= "data4", driver="KML")
Im run the final KML but the result is wrong.
data4<- structure(list(LATITUD = c("2.90198", "3.02982", "2.89649", "2.868617",
"2.58123", "3.03587", "2.94555", "2.94555", "2.85666", "2.94333",
"2.89674", "2.98455", "2.93722", "2.96538", "2.94527"), LONGITUD = c("-76.32921",
"-76.76027", "-76.73383", "-76.333191", "-76.4551", "-76.77712",
"-76.34722", "-76.34777", "-76.78888", "-76.34416", "-76.35512",
"-76.79841", "-76.31972", "-76.33370", "-76.33777")), row.names = c(NA,
-15L), class = c("tbl_df", "tbl", "data.frame"))
Maybe the location step is incorrect
Thanks