Description Usage Arguments Details Value Author(s) See Also Examples
Accessor method to retrieve the species data in long format as stored as class inside the object.
1 2 3 4 5 6 7 8 9 10 | ## S4 method for signature 'Vegsoup'
species(obj)
## S4 replacement method for signature 'Vegsoup,Species'
species(obj) <- value
## S4 replacement method for signature 'Vegsoup,SpeciesTaxonomy'
species(obj) <- value
## S4 replacement method for signature 'Vegsoup,data.frame'
species(obj) <- value
## S4 replacement method for signature 'Species,data.frame'
species(obj) <- value
|
obj |
A |
value |
Not yet implemented. |
Merely a set of accessor and replacement methods for slot 'Species' of Vegsoup
objects. The "species<-"
method for value class Species
can be used to take a subset based on slot 'Species' (see ‘Examples’). Note, this method works only for subsetting an object and you can't add new species observations by this method. The "SpeciesTaxonomy"
replacement is needed in such circumstances. In either case, the value
object can't add any plots that not already exist (those returned by rownames(obj)
). However, changes in the taxonomy component (an addition of new species) can be achieved using this replacement method. The "data.frame"
exists for completeness, but is currently not implemented.
The "species<-"
method for value class "data.frame"
allows for the manipulation (replacement) of the 'abbr'
column, e.g for cases where there are no valid strings that match a refernce list. value
has to be a data.frame with two columns named "abbr"
and "taxon"
. The elements of taxon
have to match column abbr
in obj
, these will be replaced by column abbr
of the value
object.
Species
object or a subset of the input object depending on value.
Roland Kaiser
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 | require(vegsoup)
data(barmstein)
x <- barmstein
# retrieve data.frame from an Vegsoup object
spc <- species(x)
class(spc)
barplot(table(spc$cov))
# this is the number of all species observations over all plots and strata
n <- nrow(species(species(x)))
# a random sample
i <- sort(sample(n, 10))
# note, we (might) lose a plot, for sure we only get a subset of species
richness(x)
species(x)[i, ]
# now assign to Vegsoup object
species(x) <- species(x)[i, ]
richness(x)
# subset Vegsoup object by Species object
x <- y<- barmstein
n <- nrow(species(x))
# random subsample of 10 % of all recorded occurences
species(y) <- species(x)[sample(1:n, ceiling(n * 0.1))]
dim(x)
dim(y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.