select_taxonomy: Select a taxonomy in FORCIS data

View source: R/select_taxonomy.R

select_taxonomyR Documentation

Select a taxonomy in FORCIS data

Description

Selects a taxonomy in FORCIS data. FORCIS database provides three different taxonomies: "LT" (lumped taxonomy), "VT" (validated taxonomy) and "OT" (original taxonomy). See https://doi.org/10.1038/s41597-023-02264-2 for further information.

Usage

select_taxonomy(data, taxonomy)

Arguments

data

a data.frame. One obtained by ⁠read_*_data()⁠ functions.

taxonomy

a character of length 1. One among "LT", "VT", "OT".

Value

A data.frame.

Examples

# Attach the package ----
library("forcis")

# Import example dataset ----
file_name <- system.file(file.path("extdata", "FORCIS_net_sample.csv"), 
                         package = "forcis")

net_data <- read.table(file_name, dec = ".", sep = ";")

# Add 'data_type' column ----
net_data$"data_type" <- "Net"

# Dimensions of the data.frame ----
dim(net_data)

# Select a taxonomy ----
net_data <- select_taxonomy(net_data, taxonomy = "VT")

# Dimensions of the data.frame ----
dim(net_data)

FRBCesab/forcis documentation built on Oct. 25, 2024, 9:26 a.m.