library(ggplot2)
ggplot(mtcars, aes(hp, mpg, color = am)) +
    geom_point() + geom_smooth(formula = y ~
    x, method = "loess")#> Warning: The following aesthetics were dropped during statistical transformation:
#> colour.
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#>   the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#>   variable into a factor?