manage_traits: manage_traits

View source: R/manage_traits.R

manage_traitsR Documentation

manage_traits

Description

A function to select traits based on taxonomic distance.

Usage

manage_traits(x, method = "nearest+-", traceB = FALSE)

Arguments

x

Result of assign_traits().

method

Can be nearest, ⁠nearest+⁠, ⁠nearest-⁠, ⁠nearest+-⁠ and ⁠neareast-+⁠. Please see details for further information.

traceB

If TRUE it will return a vector containing taxa excluded from the selection process because they did not meet the requirments of the selection.

Details

Method nearest selects the traits belonging to the nearest taxa irrispective of their position in the taxonomic tree. Method ⁠nearest+⁠ selects the traits belonging to the nearest taxa that have a taxonomic level equal or finer than the target one. Method ⁠nearest-⁠ does the opposite. Method ⁠nearest+-⁠ selects the traits belonging to the nearest taxa giving priority to taxa having taxonomic level equal or finer than the target one. Method ⁠nearest-+⁠ does the opposite.

Examples

data(macro_ex)

data_bio <- as_biomonitor(macro_ex)
data_agr <- aggregate_taxa(data_bio)
data_ts <- assign_traits(data_agr)

# select only the nearest traits
data_ts_sub <- manage_traits(data_ts, method = "nearest+-")

alexology/biomonitoR documentation built on Oct. 10, 2024, 12:02 a.m.