bind_plots: Bind Multiple ggplot Objects

Description Usage Arguments Value Author(s) Examples

View source: R/bind_plots.R

Description

This is an aesthetically efficient implementation of the grid.arrange

Usage

1
bind_plots(..., byrow = FALSE)

Arguments

...

(ggplot) ggplot objects to combine.

byrow

(logical) if FALSE (the default) the plots are bind by columns, otherwise the plots are bind by rows.

Value

(gtable) A plottable object with plot().

Author(s)

https://github.com/harell

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library("DALEX")
library("ingredients")

titanic_glm <- glm(survived ~ gender + age + fare,
                   data = titanic_imputed, family = "binomial")

explain_glm <- explain(titanic_glm,
                       data = titanic_imputed,
                       y = titanic_imputed$survived,
                       verbose = FALSE)

pdp_numerical <- partial_dependence(explain_glm, N = 50, variable_type = "numerical")
pdp_categorical <- partial_dependence(explain_glm, N = 50, variable_type = "categorical")

# Bind plots by rows
bind_plots(plot(pdp_numerical), plot(pdp_categorical), byrow = TRUE)

# Bind plots by columns
bind_plots(plot(pdp_numerical), plot(pdp_categorical), byrow = FALSE)

ingredients documentation built on April 10, 2021, 5:06 p.m.