View source: R/utils_S3_plots.R
plot.modeler | R Documentation |
modeler
Creates several plots for an object of class modeler
.
## S3 method for class 'modeler'
plot(
x,
id = NULL,
type = 1,
label_size = 4,
base_size = 14,
linewidth = 0.5,
color = "red",
color_points = "black",
parm = NULL,
n_points = 1000,
title = NULL,
add_points = FALSE,
add_ci = TRUE,
color_ci = "blue",
color_pi = "red",
add_ribbon_ci = FALSE,
add_ribbon_pi = FALSE,
color_ribbon_ci = "blue",
color_ribbon_pi = "red",
...
)
x |
An object of class |
id |
An optional group ID to filter the data for plotting, useful for avoiding overcrowded plots. |
type |
Numeric value (1-6) to specify the type of plot to generate. Default is 1.
|
label_size |
Numeric value for the size of labels. Default is 4. |
base_size |
Numeric value for the base font size in pts. Default is 14. |
linewidth |
Numeric value specifying size of line geoms. Default is 0.5. |
color |
Character string specifying the color for the fitted line when |
color_points |
Character string specifying the color for the raw data points when |
parm |
Character vector specifying the parameters to plot for |
n_points |
Numeric value specifying the number of points for interpolation along the x-axis. Default is 2000. |
title |
Optional character string to add a title to the plot. |
add_points |
Logical value indicating whether to add raw observations to the plot for |
add_ci |
Logical value indicating whether to add confidence intervals for |
color_ci |
Character string specifying the color of the confidence interval when |
color_pi |
Character string specifying the color of the prediction interval when |
add_ribbon_ci |
Logical value indicating whether to add a ribbon for confidence intervals in |
add_ribbon_pi |
Logical value indicating whether to add a ribbon for prediction intervals in |
color_ribbon_ci |
Character string specifying the color of the ribbon (ci). Default is "blue". |
color_ribbon_pi |
Character string specifying the color of the ribbon (pi). Default is "red". |
... |
Additional graphical parameters for future extensions. |
A ggplot
object representing the specified plot.
Johan Aparicio [aut]
library(flexFitR)
data(dt_potato)
# Example 1
mod_1 <- dt_potato |>
modeler(
x = DAP,
y = Canopy,
grp = Plot,
fn = "fn_lin_plat",
parameters = c(t1 = 45, t2 = 80, k = 0.9),
subset = c(1:3)
)
print(mod_1)
plot(mod_1, id = 1:2)
plot(mod_1, id = 1:3, type = 2, label_size = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.