View source: R/plot_light_profile.R
plot.light_profile | R Documentation |
Minimal visualization of an object of class "light_profile". The object returned is of class "ggplot" and can be further customized.
## S3 method for class 'light_profile'
plot(
x,
swap_dim = FALSE,
facet_scales = "free_x",
rotate_x = x$type != "partial dependence",
show_points = TRUE,
...
)
x |
An object of class "light_profile". |
swap_dim |
If multiflashlight and one "by" variable or single flashlight with two "by" variables, swap the role of dodge/fill variable and facet variable. If multiflashlight or one "by" variable, use facets instead of colors. |
facet_scales |
Scales argument passed to |
rotate_x |
Should x axis labels be rotated by 45 degrees? |
show_points |
Should points be added to the line (default is |
... |
Further arguments passed to |
Either lines and points are plotted (if stats = "mean") or quartile boxes.
If there is a "by" variable or a multiflashlight, this first dimension
is represented by color (or if swap_dim = TRUE
by facets).
If there are two "by" variables or a multiflashlight with one "by" variable,
the first "by" variable is visualized as color, while the second one
or the multiflashlight is shown via facet (change with swap_dim
).
An object of class "ggplot".
light_profile()
, plot.light_effects()
fit <- lm(Sepal.Length ~ ., data = iris)
fl <- flashlight(model = fit, label = "iris", data = iris, y = "Sepal.Length")
plot(light_profile(fl, v = "Species"))
plot(light_profile(fl, v = "Petal.Width", by = "Species", evaluate_at = 2:4))
plot(light_profile(fl, v = "Petal.Width", type = "predicted"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.