View source: R/autoplot_tune.R
autoplot.tune_covlmc | R Documentation |
This function prepares a plot of the results of tune_covlmc()
using
ggplot2. The result can be passed to print()
to display the result.
## S3 method for class 'tune_covlmc'
autoplot(object, ...)
object |
a |
... |
additional parameters (not used currently) |
The graphical representation proposed by this function is complete, while the
one produced by plot.tune_covlmc()
is minimalistic. We use here the
faceting capabilities of ggplot2 to combine on a single graphical
representation the evolution of multiple characteristics of the VLMC during
the pruning process, while plot.tune_covlmc()
shows only the selection
criterion or the log likelihood. Each facet of the resulting plot shows a
quantity as a function of the cut off expressed in quantile or native scale.
a ggplot object
pc <- powerconsumption[powerconsumption$week %in% 10:12, ]
dts <- cut(pc$active_power, breaks = c(0, quantile(pc$active_power, probs = c(0.5, 1))))
dts_cov <- data.frame(day_night = (pc$hour >= 7 & pc$hour <= 17))
dts_best_model_tune <- tune_covlmc(dts, dts_cov, criterion = "AIC")
covlmc_plot <- ggplot2::autoplot(dts_best_model_tune)
print(covlmc_plot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.