Learn R Programming

vegtable (version 0.1.4)

merge_taxa: Merge concepts.

Description

Merge taxon concepts form into single ones or insert accepted names to slot samples.

Usage

# S4 method for vegtable,numeric,missing
merge_taxa(object, concepts, level, ...)

# S4 method for vegtable,missing,character merge_taxa(object, concepts, level, ...)

# S4 method for vegtable taxa2samples(object, merge_to, ...)

Arguments

object

Object of class '>vegtable.

concepts

Numeric (integer) vector including taxon concepts to be merged.

level,merge_to

Character value indicating the level to which the taxa have to be merged.

...

Further arguments passed to merge_taxa ('taxlist' method).

Value

An object of class '>vegtable.

Details

This method is applied to a function defined in the package taxlist and only modify the slot 'species' in the input 'object'.

The use of 'taxa2samples' with 'merge_to' argument will produce a similar result as using 'merge_taxa' with 'level' argument, but 'taxa2samples' will replace the records in slot samples by the respective accepted names without any modification in slot species.

Examples

Run this code
# NOT RUN {
library(vegtable)
data(Kenya_veg)

## Merge Olea capensis into one
summary(subset(Kenya_veg@species, grepl("Olea capensis", TaxonName),
	slot="names"), "all")
Kenya_veg <- merge_taxa(Kenya_veg, c(52041,50432,50235))

## Check Olea capensis again
summary(subset(Kenya_veg@species, grepl("Olea capensis", TaxonName),
	slot="names"), "all")

## Effect of taxa2samples by counting taxa
count_taxa(Kenya_veg, level="genus")

Kenya_veg <- taxa2samples(Kenya_veg, merge_to="genus")
count_taxa(Kenya_veg, level="genus")
# }

Run the code above in your browser using DataLab