Skip to content

Instantly share code, notes, and snippets.

# GP Oekologie 2022
# Ingolf Kühn & Marina Golivets
# install & load R packages ------------------------------------------------------------------------
rm(list = ls())
# packages that we need for analyses
pkgs <- c(
@MarinaGolivets
MarinaGolivets / download_leda_traitbase.R
Last active October 1, 2023 15:03
An R script to download data files from the LEDA trait database
# load packages
library(rvest)
library(here)
# create a new forder for storing data
folder_name <- here(paste0("leda_", lubridate::today()))
dir.create(folder_name)
# extract URLs and download files
read_html("https://uol.de/en/landeco/research/leda/data-files") %>%
@MarinaGolivets
MarinaGolivets / match_taxon_names_to_gbif.R
Last active October 1, 2023 15:59
An R function for standardising plant taxon names against the GBIF taxonomic backbone
# as input, provide a vector of verbatim taxon names (preferably with authorship)
# and a vector of existing local identifiers for those names
# load R packages
library(dplyr)
library(tidyr)
match_to_gbif.fn <- function(taxon_name, taxon_id, include_genus = FALSE) {
# perform initial matching in parallel