keepTaxon: Keep Items (Taxa, Populations, Samples, Morphological...

Description Usage Arguments Value Examples

View source: R/keep.itemInMorphodataObject.R

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

1
2
3
4
5
6
7
keepTaxon(object, taxonName)

keepPopulation(object, populationName)

keepSample(object, sampleName = NULL, missingPercentage = NA)

keepCharacter(object, characterName)

Arguments

object

an object of class morphodata.

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 missingPercentage will be kept.

characterName

vector of characters to be kept.

Value

an object of class morphodata with the following elements:

ID

IDs of each row of data object.

Population

population membership of each row of data object.

Taxon

taxon membership of each row of data object.

data

data.frame of individuals (rows) and values of measured morphological characters (columns).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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"))

MorphoTools2 documentation built on Dec. 11, 2021, 9:55 a.m.