plot.light_effects: Visualize Multiple Types of Profiles Together

View source: R/light_effects.R

plot.light_effectsR Documentation

Visualize Multiple Types of Profiles Together

Description

Visualizes response-, prediction-, partial dependence, and/or ALE profiles of a (multi-)flashlight with respect to a covariable v. Different flashlights or a single flashlight with one "by" variable are separated by a facet wrap.

Usage

## S3 method for class 'light_effects'
plot(
  x,
  use = c("response", "predicted", "pd"),
  zero_counts = TRUE,
  size_factor = 1,
  facet_scales = "free_x",
  facet_nrow = 1L,
  rotate_x = TRUE,
  show_points = TRUE,
  recode_labels = NULL,
  ...
)

Arguments

x

An object of class "light_effects".

use

A vector of elements to show. Any subset of ("response", "predicted", "pd", "ale") or "all". Defaults to all except "ale"

zero_counts

Logical flag if 0 count levels should be shown on the x axis.

size_factor

Factor used to enlarge default size/linewidth in ggplot2::geom_point() and ggplot2::geom_line().

facet_scales

Scales argument passed to ggplot2::facet_wrap().

facet_nrow

Number of rows in ggplot2::facet_wrap().

rotate_x

Should x axis labels be rotated by 45 degrees?

show_points

Should points be added to the line (default is TRUE).

recode_labels

Named vector of curve labels. The names refer to the usual labels, while the values are the desired labels, e.g., 'c("partial dependence" = PDP", "ale" = "ALE").

...

Further arguments passed to geoms.

Value

An object of class "ggplot".

See Also

light_effects(), plot_counts()


mayer79/flashlight documentation built on Feb. 13, 2024, 1:09 p.m.