I have a dataset with three variables related to coordinates: UTMX, UTMY and HUSO.
I'd like to create a map where all the points were shown.
Here an example of the dataframe:
x y huso
1 474731 4539196 30
2 518127 4539351 30
3 488067 4521530 30
4 459943 4528829 30
5 497732 4539816 30
6 502623 4531443 30
I have tried to plot the coordenates:
coordenadas_UTM <- SpatialPointsDataFrame(coords=coordenadas,
data=coordenadas,
proj4string = CRS("+proj=utm +zone=30 +north +ellps=WGS84 +units=m +no_defs"))
m <- leaflet(coordenadas) %>% setView(lat = 40.416775, lng = -3.703790, zoom = 5) %>%
addProviderTiles(providers$CartoDB.Positron)
m %>% addMarkers(lng=coordenadas_UTM@data$x, lat=coordenadas_UTM@data$y )
I have two things that I think they are not ok. Transformation from UTM to lat/lng...I tried some packages but I didn't get it working and I can't download any map from Google or OpenStreetMaps.
Does anyone build a map with any packages (ggmap, ggplot, leaflet...) with UMT coordenates?
Thank you in advanced.