Species {vegsoup} | R Documentation |
Vegsoup*
Objects Accessor method to retrieve the species data in long format as stored as class inside the object.
## 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
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)