Shows data points appearing, then animates the regression line being drawn with optional confidence bands and residuals.
Usage
animate_regression(
data,
x,
y,
show_residuals = FALSE,
show_ci = FALSE,
ci_level = 0.95,
point_color = BLUE,
line_color = RED,
axes = NULL,
duration = 5
)