Learn R Programming

Momocs (version 1.0.0)

classify: Classify using LDA

Description

Classify using LDA

Usage

classify(x, fac, ref, unk)

Arguments

x
a Coe
fac
a standalone factor, or the name or id of the $fac column to use.If it contains NAs, they will also be removed first from the x object
ref
at least two level names from $fac[, "fac"] to use as a training subset of x
unk
same as above for one level name to classify

Value

a list with components:
  • $N_ref the number of elements in the training set
  • $N_unk the number of elements in the unknown set
  • $counts counts of classification of 'unk' in each class of 'ref'
  • $pc same thing as percentages
  • $probs same thing as posterior probabilities
  • $probs same thing as posterior but as a data.frame

Examples

Run this code
data(olea)
table(olea, "var")
x <- opoly(olea, 5, verbose=FALSE)
classify(x, fac="var", ref=c("Aglan","Cypre"), unk="PicMa")

Run the code above in your browser using DataLab