Skip to content

Commit

Permalink
add vernacular names
Browse files Browse the repository at this point in the history
  • Loading branch information
janneadolf committed Oct 8, 2024
1 parent b7b918a commit 6b71a04
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions source/report/species_occurence_maps.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ species_info <- rgbif::name_backbone_checklist(
verbose = TRUE,
strict = TRUE
)
#
# get and add vernacular names
species_ven_name <- get_names_gbif(
species_info$usageKey
) |>

Check warning on line 48 in source/report/species_occurence_maps.Rmd

View workflow job for this annotation

GitHub Actions / check project with checklist

file=source/report/species_occurence_maps.Rmd,line=48,col=5,[trailing_whitespace_linter] Trailing whitespace is superfluous.
dplyr::select(c("scientificName", "vernacularName"))
species_info <- dplyr::full_join(
x = species_info,
y = species_ven_name
)
```


Expand Down Expand Up @@ -133,14 +144,18 @@ occ_data_list <- do.call(
)
```

```{r transform-occurence-data}

```{r read-map-flanders, results='hide'}
# load map of Flanders (in Belgian Lambert 72)
map_flan <- sf::st_read(dsn = "../../data/raw/VRBG_toestand_16-08-2022_GewVLA_Shapefile/Shapefile/Refgem.shp")
# files downloaded from:
# https://download.vlaanderen.be/product/7904-voorlopig-referentiebestand-gemeentegrenzen-toestand-16082022
```

```{r transform-occurence-data}
#
##
occ_data_list_sflamb <- occ_data_list |> lapply(
X = _,
FUN = function(x) {
Expand All @@ -158,17 +173,14 @@ occ_data_list_sflamb <- occ_data_list |> lapply(
# transform coordinates
sf::st_transform(
x = _,
crs = "EPSG:31370" # EPSG code for Belgian Lambert 72
crs = "EPSG:31370" # EPSG code for Belgian Lambert 72 (CRS of map)
)
}
)
```





```{r plot-maps}
#
plot_occ_list <- lapply(
Expand Down Expand Up @@ -197,7 +209,7 @@ plot_occ_list <- lapply(
keys_zero <- species_counts |> dplyr::filter(count == 0) |> dplyr::pull(key)
names_zero <- species_info |>
dplyr::filter(usageKey %in% as.numeric(keys_zero )) |>
dplyr::pull("canonicalName")
dplyr::select(c("scientificName", "vernacularName"))
print(names_zero)
```
\newpage
Expand All @@ -209,8 +221,8 @@ keys_nonzero <- species_counts |> dplyr::filter(count > 0) |> dplyr::pull(key)
key_i <- keys_nonzero[i]
name_i <- species_info |>
dplyr::filter(usageKey == as.numeric(key_i)) |>
dplyr::pull("canonicalName")
cat(paste0('\n\n## ', name_i))
dplyr::select(c("scientificName", "vernacularName"))
cat(paste0('\n\n## ', paste(name_i, collapse = " | ")))
print(plot_occ_list[[i]])
cat("\\clearpage")
}
Expand Down

0 comments on commit 6b71a04

Please sign in to comment.