layer_fit_data: Add data to plot

Description Usage Arguments Computed variables

View source: R/layer_fit_data.R

Description

Add the data used to fit the model on which the ggeffects grid is based. Data can be residualized (with residualize_over_grid()) for partial residual plots and/or collapsed across a grouping variable (with collapse_by_group()).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
layer_fit_data(
  mapping = NULL,
  geom = "point",
  stat = "identity",
  position = "identity",
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE,
  residuals = FALSE,
  collapse.by = NULL,
  ...
)

Arguments

mapping

Set of aesthetic mappings created by aes() or aes_(). If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.

geom

The geometric object to use display the data

stat

The statistical transformation to use on the data for this layer, as a string.

position

Position adjustment, either as a string, or the result of a call to a position adjustment function.

show.legend

logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes. It can also be a named logical vector to finely select the aesthetics to display.

inherit.aes

If FALSE, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. borders().

residuals

Return partially residualized data instead of the raw data?

collapse.by

For multilevel models, the name of the random grouping variable over which data should be aggregated prior to plotting. If TRUE, the first grouping variable will be used.

Computed variables


mattansb/ggggeffects documentation built on Dec. 21, 2021, 2:55 p.m.