Learn R Programming

ordinalForest (version 1.0)

plot.ordfor: Visualization of optimized partition

Description

Visualization of the optimized partition of [0,1] interpretable as the relative widths of the classes of the ordinal target variable.

Usage

# S3 method for ordfor
plot(x, useggplot = TRUE, ...)

Arguments

x

object of class ordfor. See function ordfor.

useggplot

logical. Should R package ggplot2 be used to produce a more neatly looking plot?

...

other parameters to be passed through to plotting functions if useggplot=FALSE.

Value

If useggplot = TRUE (default) a ggplot x is returned where the ggplot2 plot is also shown on the current device. See ?ggplot for saving ggplot2 plots. If useggplot = FALSE NULL is returned.

Examples

Run this code
# NOT RUN {
data(hearth)

set.seed(123)
hearthsubset <- hearth[sort(sample(1:nrow(hearth), size=floor(nrow(hearth)*(1/2)))),]
ordforres <- ordfor(depvar="Class", data=hearthsubset, ndiv=80, nbest=5)
# NOTE: ndiv=80 is not enough!! In practice, ndiv=1000 (default value) or a higher
# number should be used.

plot(ordforres)

plot(ordforres, useggplot=FALSE)

# }

Run the code above in your browser using DataLab