Description Usage Arguments Value Author(s)
From a one dimensional GAM model produced by mgcv::gam()
, produces a ggplot2 based plot of
selected smooth parameters in a multi-panel display.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | plot_gam_1d(
gam_model = NULL,
select_smooth_terms = NULL,
columns = 2,
col_width = 4,
row_height = 4,
n_points = 100,
se = TRUE,
se_fill = NA,
se_color = "red",
title = NULL,
subtitle = NULL,
center_titles = FALSE,
x_limits = NULL,
x_major_breaks = waiver(),
y_limits = NULL,
y_major_breaks = waiver(),
line_width = 1,
line_color = "black"
)
|
gam_model |
A |
select_smooth_terms |
A string vector of one or more data variables from the GAM model to be plotted.
If |
columns |
An integer that sets the number of columns for the multi-panel display. |
col_width |
An integer that sets the width of each plot column in inches. |
row_height |
An integer that sets the height of each plot column in inches. |
n_points |
An integer that sets the number of points used for each 1-d plot. |
se |
A logical which if TRUE upper and lower lines are plotted at 2 standard errors above and below the the smooth being plotted. |
se_fill |
A string that sets the fill color between the standard error lines. |
se_color |
A string that sets the color of the standard error lines. |
title |
A string that sets the plot title. |
subtitle |
A string that sets the plot subtitle. |
center_titles |
A logical which if |
x_limits |
Depending on the class of |
x_major_breaks |
A numeric vector that defines the exact major tic locations along the x axis for all
smooth parameters. If not set then each smooth parameter has their own x axis scaling using ggplot2 defaults. In
addition the argument may be assigned to a named list (e.g. |
y_limits |
A numeric 2 element vector that sets the minimum and maximum for the y axis for all smooth parameters. |
y_major_breaks |
A numeric vector that defines the exact major tic locations along the y axis for all
smooth parameters. If not set then each smooth parameter has their own y axis scaling using ggplot2 defaults. In
addition the argument may be assigned to a named list (e.g. |
line_width |
A numeric value that sets the width of lines. |
line_color |
A string that sets the color of the lines. |
A ggplot2 plot object
Rick Dean
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.