I´m trying to create a range map in R, which is supposed to show the occurrences of a specific tree species (Quercus cerris) in the world. For this, I use the BIEN database and the function BIEN_ranges_species()
. I managed to create the map of the world, but the marks which show the occurrences of the trees cannot be seen. There might be a problem with the layer which shows the occurrences.
The following code is based on the example that BIEN recommends:
library(BIEN)
library(maps)
library(sf)
species_vector <- c("Quercus_cerris")
BIEN_ranges_species(species_vector)
BIEN_ranges_species(species_vector, match_names_only = TRUE)
temp_dir <- file.path("C:/Users/Nele/Documents/R_Karten")
BIEN_ranges_species(species = species_vector,
directory = temp_dir)
BIEN_ranges_species("Quercus_cerris")
BIEN_ranges_species("Quercus_cerris",
directory = temp_dir)
Quercus_test <- st_read(dsn = temp_dir,
layer = "Quercus_cerris")
plot(Quercus_test[1])
map('world', fill = TRUE, col = "grey")
plot(Quercus_test[1],
col = "red",
add = TRUE)
In addition, when I only plot the data for Quercus cerris, using this part of the code:
plot(Quercus_test[1],
col = "red",
add = TRUE)
there is also no visible data.
vignette('BIEN_tutorial', package = 'BIEN') and
quercus <- BIEN_ranges_species(species_vector, match_names_only = TRUE), then
str(quercus)` shows there's 1 observation of Quercus cerris, which, as a point, might not show up on a world map. And there are no observations from BIEN_occurence_species. And if you have observations, you can add to the BIEN data.