geom_smooth() is a powerful function in the ggplot2 package.

What does geom_smooth() do?

  • visualizing trends and relationships in your data.
  • add smooth curves to your scatter plots, thus making it easier to visualize the data.
  • helping you uncover trends and patterns in your data.

Basic Usage


# Create a scatter plot with a smooth curve
ggplot(data = mtcars, aes(x = wt, y = mpg)) +
geom_point() +

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top