::i_am("r-tutorials/SDM-lab-robis.qmd") here
here() starts at /Users/eli.holmes/Documents/GitHub/NOAAHackDays
<- here::here("r-tutorials", "data") dir_data
Here we download from OBIS using the robis package.
here() starts at /Users/eli.holmes/Documents/GitHub/NOAAHackDays
Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
Attaching package: 'rnaturalearthdata'
The following object is masked from 'package:rnaturalearth':
countries110
Loading required package: sp
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.3 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ lubridate 1.9.2 ✔ tibble 3.2.1
✔ purrr 1.0.1 ✔ tidyr 1.3.0
── 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
Attaching package: 'robis'
The following object is masked from 'package:raster':
area
Creates a sf object with a sfs_POLYGON from which we can get a polygon string. We also use this for cropping with the raster package, while we will need bbox for cropping with the stars package.
Then for the robis package we need a bounding box string.
Make a map of our region so we know we have the right area.
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.
This has many columns that we don’t need. We reduced to fewer columns.
We also added a cleaner date with YYYY-MM-DD format.
Set up the file names
Later we can reload our data as
Select species.