R/get_spat_occ.R
get_spat_occ.Rd
Get Spatial polygons (SpatVectors) of species based on its distribution (states and biomes) according to Flora e Funga do Brasil
get_spat_occ(
data,
species,
state = TRUE,
biome = TRUE,
intersection = TRUE,
state_vect = NULL,
state_column = NULL,
biome_vect = NULL,
biome_column = NULL,
verbose = TRUE
)
(data.frame) the data.frame imported with the
load_florabr
function.
(character) one or more species names (only genus and specific epithet, eg. "Araucaria angustifolia")
(logical) get SpatVector of states with occurrence of the species? Default = TRUE
(logical) get SpatVector of biomes with occurrence of the species? Default = TRUE
(character) get a Spatvector representing the intersection between states and biomes with occurrence of the specie? To use intersection = TRUE, you must define state = TRUE and biome = TRUE". Default = TRUE
(SpatVector) a SpatVector of the Brazilian states. By default, it uses the SpatVector provided by geobr::read_state(). It can be another Spatvector, but the structure must be identical to geobr::read_state().
(character) name of the column in state_vect containing state abbreviations. Only use if biome_vect is not null.
(SpatVector) a SpatVector of the Brazilian biomes. By default, it uses the SpatVector provided by geobr::read_biomes(). It can be another SpatVector, but the structure must be identical to geobr::read_biomes().
(character) name of the column in biome_vect containing names of brazilian biomes (in English: "Amazon", "Atlantic_Forest", "Caatinga", "Cerrado", "Pampa" and "Pantanal". Only use if biome_vect is not null.
(logical) Whether to display species being filtered during function execution. Set to TRUE to enable display, or FALSE to run silently. Default = TRUE.
A list with SpatVectors of states and/or biomes and/or Intersections for each specie.
Flora e Funga do Brasil. Jardim Botânico do Rio de Janeiro. Available at: http://floradobrasil.jbrj.gov.br/
library(terra)
#> terra 1.7.83
data("bf_data") #Load Flora e Funga do Brasil data
spp <- c("Araucaria angustifolia", "Adesmia paranensis") #Example species
#Get states, biomes and intersection states-biomes of species
spp_spt <- get_spat_occ(data = bf_data, species = spp, state = TRUE,
biome = TRUE, intersection = TRUE, state_vect = NULL,
biome_vect = NULL, verbose = TRUE)
#> Getting states of Araucaria angustifolia
#> Getting biomes of Araucaria angustifolia
#> Getting biomes of Araucaria angustifolia
#> Getting states of Adesmia paranensis
#> Getting biomes of Adesmia paranensis
#> Getting biomes of Adesmia paranensis
#Plot states of occurrence of Araucaria angustifolia
plot(spp_spt[[1]]$states, main = names(spp_spt)[[1]])
#Plot biomes of occurrence of Araucaria angustifolia
plot(spp_spt[[2]]$biomes, main = names(spp_spt)[[2]])
#Plot intersection between states and biomes of occurrence of
#Araucaria angustifolia
plot(spp_spt[[1]]$states_biomes)