crbiodiversity: un paquete de R para buscar, descargar y visualizar datos de biodiversidad de Costa Rica

Datos de biodiversidad de Costa Rica

Biodiversidad de Costa Rica
Autor/a
Afiliación
Fecha de publicación

19 de junio de 2023

Descripción del paquete

crbiodiversity es un paquete de R para buscar, descargar y visualizar datos de biodiversidad de Costa Rica.

install.packages("devtools")

Cargar el paquete:

library(devtools)
Loading required package: usethis

Luego proceder a instalar crgeo desde github:

devtools::install_github("ManuelSpinola/crbiodiversity")

y cargar el paquete:

library(crbiodiversity)

Además instalar estos otros paquetes:

devtools::install_github("ManuelSpinola/crgeo")
Using github PAT from envvar GITHUB_PAT. Use `gitcreds::gitcreds_set()` and unset GITHUB_PAT in .Renviron (or elsewhere) if you want to use the more secure git credential store instead.
Skipping install of 'crgeo' from a github remote, the SHA1 (fa77fe6e) has not changed since last install.
  Use `force = TRUE` to force installation
devtools::install_github("ManuelSpinola/crgrids")
Using github PAT from envvar GITHUB_PAT. Use `gitcreds::gitcreds_set()` and unset GITHUB_PAT in .Renviron (or elsewhere) if you want to use the more secure git credential store instead.
Skipping install of 'crgrids' from a github remote, the SHA1 (908bc0f3) has not changed since last install.
  Use `force = TRUE` to force installation

Ejemplo del uso de crbiodiversity:

library(tidyverse)
library(spocc)
library(sf)
library(crgeo)
library(crgrids)
library(crbiodiversity)

Buscar los registros del vampiro (Desmodus rotundus) con coordenadas geográficas para Costa Rica en los portales de datos GBIF e iNaturalist.

loc <- get_locations("Desmodus rotundus")
head(loc)
# A tibble: 6 × 6
  name                                 longitude latitude prov  date       key  
  <chr>                                <chr>     <chr>    <chr> <date>     <chr>
1 Desmodus rotundus (E.Geoffroy, 1810) -83.8865… 10.5383… gbif  2025-01-06 5007…
2 Desmodus rotundus (E.Geoffroy, 1810) -83.8864… 10.5384… gbif  2025-01-06 5007…
3 Desmodus rotundus (E.Geoffroy, 1810) -84.18884 9.524806 gbif  2025-02-01 5063…
4 Desmodus rotundus (E.Geoffroy, 1810) -84.8269… 10.3800… gbif  2025-05-17 5167…
5 Desmodus rotundus (E.Geoffroy, 1810) -85.0721… 9.868216 gbif  2024-01-18 4606…
6 Desmodus rotundus (E.Geoffroy, 1810) -85.0531… 9.669883 gbif  2024-02-09 4522…

Obtener los registros como objeto sf:

loc_sf <- get_locations("Desmodus rotundus", sf = TRUE)
Warning: attribute variables are assumed to be spatially constant throughout
all geometries
loc_sf
Simple feature collection with 488 features and 5 fields
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: -85.75 ymin: 8.404115 xmax: -82.94 ymax: 10.88139
Geodetic CRS:  WGS 84
# A tibble: 488 × 6
   name                 prov  date       key   COUNTRY             geometry
 * <chr>                <chr> <date>     <chr> <chr>            <POINT [°]>
 1 Desmodus rotundus (… gbif  2025-01-06 5007… Costa … (-83.88655 10.53837)
 2 Desmodus rotundus (… gbif  2025-01-06 5007… Costa … (-83.88649 10.53845)
 3 Desmodus rotundus (… gbif  2025-02-01 5063… Costa … (-84.18884 9.524806)
 4 Desmodus rotundus (… gbif  2025-05-17 5167… Costa … (-84.82694 10.38007)
 5 Desmodus rotundus (… gbif  2024-01-18 4606… Costa … (-85.07214 9.868216)
 6 Desmodus rotundus (… gbif  2024-02-09 4522… Costa … (-85.05318 9.669883)
 7 Desmodus rotundus (… gbif  2024-03-15 4958… Costa …  (-83.6072 10.01294)
 8 Desmodus rotundus (… gbif  2024-06-17 4900… Costa … (-84.01013 10.43689)
 9 Desmodus rotundus (… gbif  2024-06-17 4900… Costa … (-84.00368 10.43234)
10 Desmodus rotundus (… gbif  2024-06-17 4901… Costa … (-84.03015 10.51856)
# ℹ 478 more rows

Visualizar los registros del vampiro (Desmodus rotundus) en una grilla de 8km x 8km.

get_map("Desmodus rotundus")
Warning: attribute variables are assumed to be spatially constant throughout
all geometries

Para más información del paquete se puede visitar este enlace https://github.com/ManuelSpinola/crbiodiversity

Cómo citar

BibTeX
@online{spínola2023,
  author = {Spínola, Manuel},
  title = {crbiodiversity: un paquete de R para buscar, descargar y
    visualizar datos de biodiversidad de Costa Rica},
  date = {2023-06-19},
  url = {https://mspinola-ciencia-de-datos.netlify.app/posts/2023-06-19-crbiodiversity/crbiodiversity.html},
  langid = {es}
}
Por favor, cita este trabajo como:
Spínola, Manuel. 2023. “crbiodiversity: un paquete de R para buscar, descargar y visualizar datos de biodiversidad de Costa Rica.” June 19, 2023. https://mspinola-ciencia-de-datos.netlify.app/posts/2023-06-19-crbiodiversity/crbiodiversity.html.