Skip to content
Prev 14748 / 15379 Next

[R-es] ggplot2 vs plot

Hola David, 

Quizás esto te puede ayudar.

He comentado la lineas de los otros métodos de ajuste disponibles en la función status_smooth().

library("tidyverse")
pet <-  ggplot(data = cars, aes(x = speed, y = dist)) + 
  geom_point(stat="identity", color = "blue", alpha=0.9) + 
  stat_smooth(method="lm", color = "red")+
  #stat_smooth(method="loess", color = "red")+
  #stat_smooth(method="gam", color = "red")+
  theme_bw()
pet


Las salidas con ?loess? y ?lm"



Espero ayude 

Saludos