Skip to content

Instantly share code, notes, and snippets.

@alfcrisci
Last active August 29, 2015 14:16
Show Gist options
  • Save alfcrisci/0a66f5a0f5658aa1230c to your computer and use it in GitHub Desktop.
Save alfcrisci/0a66f5a0f5658aa1230c to your computer and use it in GitHub Desktop.
viewwhere<-function(object,zoom = 17){
require(leaflet)
if (is.null(object$lon) && is.null(object$lat))
{ stop("Object must be have coordinates lat and lon slot." )};
m = leaflet() %>% addTiles()
m = m %>% setView(object$lon, object$lat, zoom = zoom)
m %>% addPopups(object$lon,object$lat, paste0('The location of the object is here!'))
return(m)
}
@alfcrisci
Copy link
Author

to play.... with leaflet Rstudio package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment