library(rgbif)
library(sf)
library(tidyverse)
library(rnaturalearth)
library(rnaturalearthdata)
Introduction
The Crested caracara’s I talked about in my last post are sitting on top of a Giant Cardon Cacti (Pachycereus pringlei). I wanted to take a look to see if the cacti were as widely distributed in the area as the Caracaras.
Load the libraries
Subset our search to only Southern Baja Sur.
<- paste('POLYGON((-112.632285206 22.4136232805, -109.1001807138 22.4136232805, -109.1001807138 25.4259663625, -112.632285206 25.4259663625, -112.632285206 22.4136232805))')
baja_geometry
<- occ_data(scientificName = "Pachycereus pringlei", hasCoordinate = TRUE, limit = 10000,
cacti geometry = baja_geometry )
<- cacti$data[ , c("decimalLongitude", "decimalLatitude",
cacti_coords "individualCount", "occurrenceStatus", "coordinateUncertaintyInMeters",
"institutionCode", "references")]
I subset the larger dataset to just zoom in on Mexico and plot the appoximate location where my observation was.
<- data.frame(decimalLongitude = c(-110.18917658541324), decimalLatitude = c(23.369598786877447))
cacti_obs
<- ne_countries(scale = "medium", returnclass = "sf")
world_maps <- subset(world_maps, name == "Mexico")
mexico
ggplot(data = mexico) +
geom_sf() +
geom_point(data = cacti_obs, aes(x = decimalLongitude, y = decimalLatitude), color = 'red')
Zoom into the Baja penninsula and plot all the points. There have been many observations of both the Giant Cardon Cacti and the Crested caracara all over the general region I visited.
theme_set(theme_bw())
ggplot(data = mexico) +
geom_sf() +
geom_point(data = cacti_coords, aes(x = decimalLongitude, y = decimalLatitude), color = 'blue') +
geom_point(data = cacti_obs, aes(x = decimalLongitude, y = decimalLatitude), color = 'red')
ggplot(data = mexico) +
geom_sf() +
geom_point(data = cacti_coords, aes(x = decimalLongitude, y = decimalLatitude), color = 'blue') +
geom_point(data = cacti_obs, aes(x = decimalLongitude, y = decimalLatitude), color = 'red') +
coord_sf(xlim = c(-115, -109), ylim = c(22.5, 27), expand = TRUE) +
xlab("Longitude") + ylab("Latitude")
ggsave("~/DATA/images/cardon-cacti-map.png")