Plot prediction of gam model
plot_gam_predict(
Model,
xcol,
ycol,
ByFactor,
symsize = 1,
s_alpha = 0.1,
smooth_alpha = 0.7,
linethick,
fontsize = 20,
...
)a generalised additive model (gam) fitted with ga_model or mgcv
the smooth in the gam (should match variable in the model exactly)
the dependent variable in gam (should match variable in the model exactly)
the by factor used in gam (should match variable in the model exactly)
size of symbols (default = 1)
opacity of symbols (default = 0.1)
opacity of the predicted CI interval (default = 0.7)
thickness of symbol lines (default = fontsize/22)
base font size for graph
additional arguments to pass to plot_xy_CatGroup.
This function returns a ggplot2 object of class "gg" and "ggplot".
#fit zooplankton data
z1 <- ga_model(data = data_zooplankton,
Y_value = "log(density_adj)",
Fixed_Factor = "taxon",
Smooth_Factor = "day")
#plot fitted data
plot_gam_predict(Model = z1,
xcol = day,
ycol = `log(density_adj)`,
ByFactor = taxon)