taxlist (version 0.1.7)

taxon_relations: Retrieve or replace slot taxonRelations in taxlist objects

Description

Retrieve the content of slot 'taxonRelations' from a '>taxlist object or replace it by a new data frame.

Usage

# S4 method for taxlist
taxon_relations(taxlist, ...)

taxon_relations(taxlist) <- value

# S4 method for taxlist,character add_concept(taxlist, TaxonName, Level, ...)

# S4 method for taxlist,taxlist add_concept(taxlist, TaxonName, insert_view, ...)

# S4 method for taxlist,numeric update_concept(taxlist, ConceptID, ...)

Arguments

taxlist

A '>taxlist object.

value

A 'data.frame' object to be set as slot 'taxonRelations'.

TaxonName

Character vector with the accepted name for the new taxon concepts.

Level

Character vector indicating the level of the concept in the list.

insert_view

A numeric (integer) vectors, indicating the views of 'TaxonName' to be inserted in 'taxlist' or the value 'TRUE' (see details).

ConceptID

Concept IDs to be updated.

...

Further arguments passed among methods.

Value

An object of class '>taxlist with added names and concepts.

Details

The replacement method 'taxon_relatiions<-' should be only used when constructing '>taxlist objects from an empty one (prototype).

New concepts should be first added to a '>taxlist object using their respective accepted names. Synonyms can be further provided using the function add_synonym.

Additional named vectors can be provided to be included in slot 'taxonNames', in the cases where those variables already exist, otherwise they will be ignored.

It is recommended also to provide a concept view as 'ViewID' (see taxon_views). For adding a new view, use add_view.

See Also

'>taxlist, add_synonym.

Examples

Run this code
# NOT RUN {
library(taxlist)
data(Easplist)

## Subset for the genus Euclea and display of slot 'taxonNames'
Euclea <- subset(Easplist, charmatch("Euclea", TaxonName), slot="names")
Euclea <- get_children(Easplist, Euclea)

summary(Euclea)
taxon_relations(Euclea)

## Subset with family Ebenaceae and children
Ebenaceae <- subset(Easplist, charmatch("Ebenaceae", TaxonName))
Ebenaceae <- get_children(Easplist, Ebenaceae)

summary(Ebenaceae)
summary(Ebenaceae, "all", maxsum=100)

## Adding a new concept
Ebenaceae <- add_concept(Ebenaceae, TaxonName="Euclea acutifolia",
AuthorName="E. Mey. ex A. DC.", Level="species", Parent=55707, ViewID=1)

## A summary again  
summary(Ebenaceae)
summary(Ebenaceae, "all", maxsum=100)

## Display two Typha species
summary(Easplist, c("Typha domingensis","Typha latifolia"))

## Update a concept
summary(Easplist, "Corchorus olitorius")
Easplist <- update_concept(Easplist, 155, Level="subspecies")
summary(Easplist, "Corchorus olitorius")
# }

Run the code above in your browser using DataCamp Workspace