plot_counts {flashlight} | R Documentation |
DEPRECATED - Add Counts to Effects Plot
Description
Add counts as labelled bar plot on top of light_effects plot.
Usage
plot_counts(
p,
x,
text_size = 3,
facet_scales = "free_x",
show_labels = TRUE,
big.mark = "'",
scientific = FALSE,
digits = 0,
...
)
Arguments
p |
The result of |
x |
An object of class "light_effects". |
text_size |
Size of count labels. |
facet_scales |
Scales argument passed to |
show_labels |
Should count labels be added as text? |
big.mark |
Parameter passed to |
scientific |
Parameter passed to |
digits |
Used to round the labels. Default is 0. |
... |
Further arguments passed to |
Details
Experimental. Uses package ggpubr to rearrange the figure.
Thus, the resulting plot cannot be easily modified.
Furthermore, adding counts only works if the legend in plot.light_effects()
is not placed on the left or right side of the plot.
It has to be placed inside or at the bottom.
Value
An object of class "ggplot".
See Also
Examples
fit <- lm(Sepal.Length ~ ., data = iris)
fl <- flashlight(model = fit, label = "iris", data = iris, y = "Sepal.Length")
x <- light_effects(fl, v = "Species")
plot_counts(plot(x), x, width = 0.3, alpha = 0.2)