taxon_relations: Retrieve or replace slot taxonRelations in taxlist objects

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## S4 method for signature 'taxlist'
taxon_relations(taxlist, ...)

taxon_relations(taxlist) <- value

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

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

## S4 method for signature '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.

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.

Value

An object of class taxlist with added names and concepts.

Author(s)

Miguel Alvarez, [email protected].

See Also

taxlist, add_synonym.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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")

taxlist documentation built on July 2, 2018, 1:03 a.m.