Skip to content

Instantly share code, notes, and snippets.

@emhart
Created April 1, 2014 20:41
Show Gist options
  • Save emhart/9922731 to your computer and use it in GitHub Desktop.
Save emhart/9922731 to your computer and use it in GitHub Desktop.
code for ropensci hackathon wolf map
install.packages("spocc")
library(spocc)
map3 <- Leaflet$new()
map3$setView(c(39.828127, -98.579404), zoom = 2)
tmp <- occ(query = 'Canis lupus', from = c('gbif','ecoengine','inat'),limit = 100)
testdf <- occ2df(tmp)
### To lat lon matrix
testll <- cbind(testdf$lat,testdf$lon)
### Strip out NA's
testll <- testll[!is.na(testll[,1]),]
map3$addCluster(testll)
#(L1$getPayload('chart'))
map3$save("~/Documents/wolfmap.html",cdn=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment