Residuals method for an object of class "flashlight". Pass additional elements to update the flashlight before calculation of residuals.
# S3 method for class 'flashlight'
residuals(object, ...)
A numeric vector with residuals.
fit <- lm(Sepal.Length ~ ., data = iris)
x <- flashlight(model = fit, data = iris, y = "Sepal.Length", label = "ols")
residuals(x)[1:5]
#> 1 2 3 4 5
#> 0.09521198 0.14315645 -0.07309695 -0.28935683 -0.05437691