Learn R Programming

imputeTestbench (version 3.0.3)

plot_errors: Function to plot the Error Comparison

Description

Function to plot the Error Comparison

Usage

plot_errors(dataIn, plotType = c("boxplot"))

# S3 method for errprof plot_errors(dataIn, plotType = c("boxplot"))

Arguments

dataIn

an errprof object returned from impute_errors

plotType

chr string indicating plot type, accepted values are "boxplot", "bar", or "line"

Value

A ggplot object that can be further modified. The entire range of errors are shown if plotType = "boxplot", otherwise the averages are shown if plotType = "bar" or "line".

Examples

Run this code
# NOT RUN {
aa <- impute_errors(dataIn = nottem)

# default plot
plot_errors(aa)
# }
# NOT RUN {
# bar plot of averages at each repetition
plot_errors(aa, plotType = 'bar')

# line plot of averages at each repetition
plot_errors(aa, plotType = 'line')

# change the plot aesthetics

library(ggplot2)
p <- plot_errors(aa)
p + scale_fill_brewer(palette = 'Paired', guide_legend(title = 'Default'))
p + theme(legend.position = 'top')
p + theme_minimal()
p + ggtitle('Distribution of error for imputed values')
p + scale_y_continuous('RMSE')
# }

Run the code above in your browser using DataLab