Taxonomy-class: Class Taxonomy

Description Objects from the Class Slots Methods Author(s) See Also Examples

Description

Data representation of taxonomic reference list.

Objects from the Class

Objects can be created by calls of the form new("Taxonomy", ...), where ... expands to slot 'data'. Using the taxonomy method with appropriate objects is also fast and convenient (see ‘Methods’).

Slots

data:

Object of class "data.frame" with at least two columns named 'abbr' and 'taxon'.

Methods

taxonomy

signature(obj = "Taxonomy"): accessor function (slot "data").

signature(obj = "SpeciesTaxonomy"): accessor function for objects of class SpeciesTaxonomy.

signature(obj = "data.frame"): promote data.frame to object of class "Taxomomy".

signature(obj = "matrix"): promote matrix to object of class "Taxomomy". Note, obj does not need to have dimnames.

signature(obj = "character"): supply a file to be read by read.csv and promote that object to class Species. Remember to pass appropriate arguments to read.csv that meet the specifications of your file.

nrow

signature(x = "Taxonomy"): the number of rows is the number of taxa.

[

signature(x = "Taxonomy"): Subset parts of an object. Note, indexing that will evaluate to an object with less than two columns will fail, due to the class inherent data model (see ‘Slots’).

bind

signature(x = "Taxonomy"): bind method to combine two or more objects. If there are any duplicates in the 'abbr' key column only one instance is kept, the first one!

Author(s)

Roland Kaiser

See Also

SpeciesTaxonomy and function SpeciesTaxonomy, Species, Sites tax in package vegdata

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require(vegsoup)

data(barmstein)
x <- barmstein
# from demonstration extract from object
x <- taxonomy(taxonomy(x)) # returns object of class 'data.frame'

t <- new("Taxonomy", data = x)

# taxonomy method for class data.frame
( t <- taxonomy(x) )
# or matrix
( t <- taxonomy(as.matrix(x)) )

#	get slot data from object
taxonomy(t)                # returns object of class 'data.frame'

# combine objects
data(windsfeld)
x <- windsfeld
t2 <- taxonomy(x)

bind(t, t2)

vegsoup documentation built on Feb. 24, 2021, 3 a.m.