subsample {nodiv} | R Documentation |
Subsampling data objects to certain species or sites
Description
Takes an object of type distrib_data
or nodiv_data
, and subsamples it to contain certain species or sites, while keeping the integrity of the data.
Usage
subsample(x, ...)
## S3 method for class 'distrib_data'
subsample(x, sites = NULL, species = NULL, ...)
## S3 method for class 'nodiv_data'
subsample(x, sites = NULL, species = NULL, node = NULL, ...)
## S3 method for class 'nodiv_result'
subsample(x, node = NULL, ...)
Arguments
x |
An object of type |
sites |
A numeric or character vector identifying the sites to keep in the new object. If specified, the function will subsample the data object to only include the defined sites, and the species that exist there. If sites == \"all\", all sites will be kept when subsampling for species, even if no species now exist in the sites. |
species |
A numeric or character vector identifying the species to keep in the new object. If specified, the function will subsample the data object to only include the defined species, and the sites where they exist. |
node |
A numeric or character vector identifying a node in the phylogeny. Only species descending from this node will be kept in the new object, and the sites where they exist. |
... |
Further arguments to the subsample function |
Value
The return value is a new object of the same type as x
Author(s)
Michael Krabbe Borregaard
See Also
distrib_data
, ~~~
Examples
## Not run:
data(coquettes)
new <- subsample(coquettes, sites = which(richness(coquettes) > 3))
plot(new, show.tip = FALSE)
## End(Not run)