plot.RFPH: Plot Post-hoc test

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/plot.RFPH.R

Description

Plots the results of rf.post.hoc.

Usage

1
2
## S3 method for class 'RFPH'
plot(x, Species = "all", q = 0.05)

Arguments

x

Object of class RFPH.

Species

Name of class to be plotted or 'all' for all classes

q

Significance level.

Details

If name of class to be plotted is specify, the plot returns the density function of the probability of assignment 'POA' to the correct class in the trainig data and the POA of the predicted data as circles symbols. Circle is filled 'red' if not significantly different at q level, otherwise 'white'. The POA at significance level q is plotted as dashed grey line.

If Species = 'all' (default), then all classes are plotted. Instead of density function for trained POA, the median (grey symbol) and the range between quantiles q and 1-q are plotted.

Value

Plot

Author(s)

Pedro Martinez Arbizu & Sven Rossel

References

Rossel, S. & P. Martinez Arbizu (2018) Automatic specimen identification of Harpacticoids (Crustacea:Copepoda) using Random Forest and MALDIā€TOF mass spectra, including a post hoc test for false positive discovery. Methods in Ecology and Evolution, 9(6):1421-1434.

https://doi.org/10.1111/2041-210X.13000

See Also

rf.post.hoc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#example with maldi data
data(maldi)
library(randomForest)
unique(maldi$species)
maldi_train <- maldi[maldi$species != 'Cletodes limicola',]
maldi_test <- maldi[maldi$species == 'Cletodes limicola',]
#exclude Cletodes limicola from factors
maldi_train$species <- factor(maldi_train$species)
rf <- randomForest(species ~ ., data = maldi_train[-1])
ph <- rf.post.hoc(rf,maldi_test)
plot(ph)
plot(ph,'Tachidius discipes')

pmartinezarbizu/RFtools documentation built on March 10, 2021, 12:11 p.m.