keepTaxon {MorphoTools2} | R Documentation |
Keep Items (Taxa, Populations, Samples, Morphological Characters) in an Morphodata Object (and Remove Others)
Description
These functions keep only selected taxa, populations, samples or morphological characters in morphodata
object. The samples can be kept by names using sampleName
argument, or by the threshold. Each sample holding less or equal portion of missing data than the desired threshold (missingPercentage
) will be kept. Only one parameter can be specified in one run.
Usage
keepTaxon(object, taxonName)
keepPopulation(object, populationName)
keepSample(object, sampleName = NULL, missingPercentage = NA)
keepCharacter(object, characterName)
Arguments
object |
an object of class |
taxonName |
vector of taxa to be kept. |
populationName |
vector of populations to be kept. |
sampleName |
vector of samples to be kept. |
missingPercentage |
a numeric, samples holding less or equal portion of missing data than specified by |
characterName |
vector of characters to be kept. |
Value
an object of class morphodata
with the following elements:
ID |
IDs of each row of |
Population |
population membership of each row of |
Taxon |
taxon membership of each row of |
data |
|
Examples
data(centaurea)
centaurea.hybr = keepTaxon(centaurea, "hybr")
centaurea.PhHybr = keepTaxon(centaurea, c("ph", "hybr"))
centaurea.PREL = keepPopulation(centaurea, "PREL")
centaurea.NA_0.1 = keepSample(centaurea, missingPercentage = 0.1)
centaurea.stem = keepCharacter(centaurea, c("SN", "SF", "ST"))