Created
April 1, 2014 20:41
-
-
Save emhart/9922731 to your computer and use it in GitHub Desktop.
code for ropensci hackathon wolf map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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