Learn R Programming

MorphoTools2 (version 1.0.2.1)

removeTaxon: Remove Items (Taxa, Populations, Morphological Characters) from Morphodata Object

Description

These functions remove particular taxa, populations, samples or morphological characters from morphodata object. The samples can be deleted by names using sampleName argument, or each sample above the desired threshold missingPercentage will be deleted. Only one parameter can be specified in one run.

Usage

removeTaxon(object, taxonName)

removePopulation(object, populationName)

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

removeCharacter(object, characterName)

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).

Arguments

object

object of class morphodata.

taxonName

vector of taxa to be removed.

populationName

vector of populations to be removed.

sampleName

vector of samples to be removed.

missingPercentage

a numeric, samples holding more missing data than specified by missingPercentage will be removed.

characterName

vector of characters to be removed.

Examples

Run this code
data(centaurea)

centaurea.3tax = removeTaxon(centaurea, "hybr")
centaurea.PsSt = removeTaxon(centaurea, c("ph", "hybr"))

centaurea.short = removePopulation(centaurea, c("LIP", "PREL"))

centaurea.NA_0.1 = removeSample(centaurea, missingPercentage = 0.1)

centaurea.short = removeCharacter(centaurea, "LL")

Run the code above in your browser using DataLab