# \donttest{
#'
library(maps)
library(ggplot2)
library(sf)
species_vector <- c("Abies_lasiocarpa","Abies_amabilis")
abies_maps <- OpenRange_load_species(species = species_vector)
# To get all maps for a species, use "default = FALSE".
# Here, this returns maps with different thresholds from the same model
std_all <- OpenRange_load_species(species = "Stellaria debilis",
default_only = FALSE)
#To just get the default map, use "default = TRUE"
std_default <- OpenRange_load_species(species = "Stellaria debilis",
default_only = TRUE)
#get world map
world <- map("world", plot = FALSE, fill = TRUE)|>
st_as_sf()
#Plotting ranges
ggplot(data = world)+
geom_sf()+
geom_sf(data = abies_maps,
mapping = aes(fill = species),
alpha=0.5)+
coord_sf(xlim = st_bbox(abies_maps)[c(1,3)],
ylim = st_bbox(abies_maps)[c(2,4)]) +
theme_bw()
# }
Run the code above in your browser using DataLab