mtcars %>% compute_smooth(mpg ~ wt, n = 10)
mtcars %>% compute_smooth(mpg ~ wt, n = 10, se = TRUE)
mtcars %>% group_by(cyl) %>% compute_smooth(mpg ~ wt, n = 10)
# Override method to suppress message or change approach
mtcars %>% compute_smooth(mpg ~ wt, n = 10, method = "loess")
mtcars %>% compute_smooth(mpg ~ wt, n = 10, method = "lm")
# Plot the results
mtcars %>% compute_smooth(mpg ~ wt) %>% ggvis(~pred_, ~resp_) %>% layer_paths()
mtcars %>% ggvis() %>% compute_smooth(mpg ~ wt) %>% layer_paths(~pred_, ~resp_)Run the code above in your browser using DataLab