Show R code
library(rebird) # ebird api
library(tidyverse) # fix data
library(sf) # vector map
library(mapview) # maps easy
library(readr) # read table
# library(traitdata)The main idea is to use the hot-spots as places were birders travel looking for birds. Ideally the number of lists per hot-spot represents the importance if each place atracting birders.
library(rebird) # ebird api
library(tidyverse) # fix data
library(sf) # vector map
library(mapview) # maps easy
library(readr) # read table
# library(traitdata)deptos <- ebirdsubregionlist("subnational1", "CO", key=EBIRD_KEY)
# loop per depto
hotspot_dept <- list()
for(i in 1: length(deptos$code)){
hotspot_dept[[i]] <- ebirdhotspotlist(#lat = 10.851286, lng = -73.655461,
regionCode=deptos$code[i],
sleep=3, # 3 seonds betwwen requests
key=EBIRD_KEY)
}
# convert to single data frame
hotspot_col <- as.data.frame(do.call(rbind, hotspot_dept))
#convert to sf
hotspots_col_sf <- st_as_sf(hotspot_col, coords = c("lng", "lat"), crs = 4326)
mapview(hotspots_col_sf)