| nl_plot | R Documentation |
Visualises results from nl_predict or
nl_derivatives. The type argument selects the plot:
"trajectory": predicted outcome vs x with optional
confidence ribbon (v1 behaviour, now default).
"slope": first derivative (marginal effect) vs x.
"curvature": second derivative vs x.
"combo": trajectory + slope panels side by side.
nl_plot(
pred_df = NULL,
deriv_df = NULL,
x,
time = NULL,
type = c("trajectory", "slope", "curvature", "combo"),
show_ci = TRUE,
ci_level = 0.95,
show_turning_points = FALSE,
turning_points = NULL,
zero_line = TRUE,
y_lab = NULL,
x_lab = NULL,
title = NULL,
legend_title = NULL
)
pred_df |
A data frame from |
deriv_df |
A data frame from |
x |
Character; name of the focal predictor column in |
time |
Optional character; name of the time column. Auto-detected if
|
type |
Plot type: |
show_ci |
Logical; add confidence ribbons. Default |
ci_level |
Numeric; confidence level when deriving CI from
|
show_turning_points |
Logical; overlay turning-point markers on the
trajectory plot. Default |
turning_points |
Data frame from |
zero_line |
Logical; for slope / curvature plots, draw a dashed
horizontal line at zero. Default |
y_lab |
Y-axis label. |
x_lab |
X-axis label. Defaults to |
title |
Optional plot title. |
legend_title |
Optional legend title. |
A ggplot object (or a combined plot list for "combo").
nl_predict, nl_derivatives,
nl_turning_points
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.