── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ tidyr::extract() masks raster::extract()
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
✖ dplyr::select() masks raster::select()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(robis)
Attaching package: 'robis'
The following object is masked from 'package:raster':
area
Load the region info
Load the bounding box polygon and create a bounding box.
#Loading bounding box for the area of interestfil <- here::here("data", "region", "BoundingBox.shp")extent_polygon <- sf::read_sf(fil)bbox <- sf::st_bbox(extent_polygon)wkt_geometry <- extent_polygon$geometry %>%st_as_text()
Make a map of our region so we know we have the right area.
world <-ne_countries(scale ="medium", returnclass ="sf")ggplot(data = world) +geom_sf() +geom_sf(data = extent_polygon, color ="red", fill=NA)
Get occurrence data from robis
We will download data for four sea turtles found in the Arabian sea and save to one file. We will use the occurrence() function in the robis package.
# turtle species we're interested inspp <-c("Chelonia mydas", "Caretta caretta", "Eretmochelys imbricata", "Lepidochelys olivacea", "Natator depressus", "Dermochelys coriacea") # subsetting all the occurence data to just those turtles occ <- io.turtles %>%subset(scientificName == spp) # subset the occurences to include just those in the waterocc <- occ %>%subset(bathymetry >0& shoredistance >0& coordinateUncertaintyInMeters <200)# seeing how often each species occurstable(occ$scientificName)
Caretta caretta Chelonia mydas
874 1190
After cleaning we discover that we only have loggerhead and green sea turtles.