Learn R Programming

rfPermute (version 2.5.2)

plotVotes: Plot Vote Distribution

Description

For classification models, plot distribution of votes for each sample in each class.

Usage

plotVotes(x, type = NULL, freq.sep.line = TRUE, plot = TRUE)

Value

the ggplot2 object is invisibly returned.

Arguments

x

a rfPermute or randomForest model object.

type

either area for stacked continuous area plot or bar for discrete stacked bar chart. The latter is prefered for small numbers of cases. If not specified, a bar chart will be used if all classes have <= 30 cases.

freq.sep.line

put frequency of original group on second line in facet label? If FALSE, labels are single line. If NULL frequencies will not be included in labels.

plot

display the plot?

Author

Eric Archer eric.archer@noaa.gov

Examples

Run this code
library(randomForest)
data(mtcars)

rf <- randomForest(factor(am) ~ ., mtcars)
plotVotes(rf)

Run the code above in your browser using DataLab