View source: R/mixed-methods.R
| plot.beezdemand_nlme | R Documentation |
Creates a ggplot2 visualization of a fitted beezdemand_nlme model,
showing observed data points and/or model prediction lines.
## S3 method for class 'beezdemand_nlme'
plot(
x,
type = c("demand", "population", "individual", "both"),
ids = NULL,
show_observed = TRUE,
observed_point_alpha = 0.6,
show_pred = "population",
n_points = 200,
inv_fun = identity,
facet = NULL,
at = NULL,
color_by = NULL,
linetype_by = NULL,
shape_by = NULL,
x_trans = c("log10", "log", "linear", "pseudo_log"),
y_trans = NULL,
free_trans = 0.01,
x_limits = NULL,
y_limits = NULL,
style = c("modern", "apa"),
title = NULL,
subtitle = NULL,
x_lab = NULL,
y_lab = NULL,
xlab = NULL,
ylab = NULL,
observed_point_size = 2,
pop_line_size = 1,
ind_line_size = 0.6,
pop_line_alpha = 0.9,
ind_line_alpha = 0.3,
...
)
x |
A |
type |
Plot type: "demand", "population", "individual", or "both". |
ids |
Optional vector of subject IDs to plot. |
show_observed |
Logical. If TRUE, plots the original data points. Default |
observed_point_alpha |
Alpha for observed points. Default |
show_pred |
Which prediction layers to plot: "population", "individual", or "both". |
n_points |
Integer. Number of points for prediction lines. Default |
inv_fun |
Optional function to inverse-transform y-axis and predictions. Default |
facet |
Optional faceting formula (e.g., |
at |
Optional named list giving values for continuous covariates used in the fixed-effects RHS. When building prediction grids for population- or individual- level lines, these values will be used. If not provided, the function will default to the median of each continuous covariate found in the original model data. Factor variables are always handled as grids (population) or observed combinations (individual) as before. |
color_by |
Optional character string: name of a factor to color lines and/or points by.
Must be a column in |
linetype_by |
Optional character string: name of a factor for linetypes of population prediction lines
if individual lines are also shown (otherwise applies to the shown lines).
Must be a model factor in |
shape_by |
Optional character string: name of a factor for shapes of observed points.
Must be a column in |
x_trans |
Character. Transformation for x-axis. Default "log". |
y_trans |
Character. Transformation for y-axis. Default "log". |
free_trans |
Value used to display free (x = 0) on log scales. Use NULL to drop x <= 0 values instead. |
x_limits |
Optional numeric vector of length 2 for x-axis limits. |
y_limits |
Optional numeric vector of length 2 for y-axis limits. |
style |
Plot styling, passed to |
title |
Optional plot title. |
subtitle |
Optional subtitle for the plot. |
x_lab |
Optional x-axis label. |
y_lab |
Optional y-axis label. |
xlab |
Deprecated alias for |
ylab |
Deprecated alias for |
observed_point_size |
Size for observed points. Default |
pop_line_size |
Size for population prediction lines. Default |
ind_line_size |
Size for individual prediction lines. Default |
pop_line_alpha |
Alpha for population prediction lines. Default |
ind_line_alpha |
Alpha for individual prediction lines. Default |
... |
Additional arguments (currently unused). |
A ggplot2 object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.