forked from AdamWilsonLabEDU/SpatialDataScience
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemo.R
More file actions
22 lines (17 loc) · 641 Bytes
/
Demo.R
File metadata and controls
22 lines (17 loc) · 641 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
## ---- message=F----------------------------------------------------------
library(dplyr)
library(ggplot2)
library(maps)
library(spocc)
## ---- cache=T, warning=F-------------------------------------------------
## define which species to query
sp='Turdus migratorius'
## run the query and convert to data.frame()
d = occ(query=sp, from='ebird',limit = 1000) %>% occ2df()
## ---- fig.width=6--------------------------------------------------------
# Load coastline
map=map_data("world")
ggplot(d,aes(x=longitude,y=latitude))+
geom_polygon(aes(x=long,y=lat,group=group,order=order),data=map)+
geom_point(col="red")+
coord_equal()