add_curve_fit {tidyplots} | R Documentation |
Add curve fit
add_curve_fit(
plot,
dodge_width = NULL,
method = "loess",
linewidth = 0.25,
alpha = 0.4,
preserve = "total",
...
)
plot |
A |
dodge_width |
For adjusting the distance between grouped objects. Defaults to |
method |
Smoothing method (function) to use, accepts either
For If you have fewer than 1,000 observations but want to use the same |
linewidth |
Thickness of the line in points (pt). Typical values range between |
alpha |
A |
preserve |
Should dodging preserve the |
... |
Arguments passed on to |
A tidyplot
object.
time_course %>%
tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>%
add_curve_fit()
# Changing arguments
time_course %>%
tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>%
add_curve_fit(linewidth = 1)
time_course %>%
tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>%
add_curve_fit(alpha = 0.8)
# Remove confidence interval
time_course %>%
tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>%
add_curve_fit(se = FALSE)