View source: R/plot_light_performance.R
plot.light_performance | R Documentation |
Minimal visualization of an object of class "light_performance" as
ggplot2::geom_bar()
. The object returned has class "ggplot",
and can be further customized.
## S3 method for class 'light_performance'
plot(
x,
swap_dim = FALSE,
geom = c("bar", "point"),
facet_scales = "free_y",
rotate_x = FALSE,
...
)
x |
An object of class "light_performance". |
swap_dim |
Should representation of dimensions
(either two "by" variables or one "by" variable and multiflashlight)
of x aesthetic and dodge fill aesthetic be swapped? Default is |
geom |
Geometry of plot (either "bar" or "point") |
facet_scales |
Scales argument passed to |
rotate_x |
Should x axis labels be rotated by 45 degrees? |
... |
Further arguments passed to |
The plot is organized as a bar plot as follows: For flashlights without "by" variable specified, a single bar is drawn. Otherwise, the "by" variable (or the flashlight label if there is no "by" variable) is represented by the "x" aesthetic.
The flashlight label (in case of one "by" variable) is represented by dodged bars. This strategy makes sure that performance of different flashlights can be compared easiest. Set "swap_dim = TRUE" to revert the role of dodging and x aesthetic. Different metrics are always represented by facets.
An object of class "ggplot".
light_performance()
fit <- lm(Sepal.Length ~ ., data = iris)
fl <- flashlight(model = fit, label = "ols", data = iris, y = "Sepal.Length")
plot(light_performance(fl, by = "Species"), fill = "darkred")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.