Is there a way to ignore outliers just for geom_smooth
, not for whole chart? I am trying to show that Olympic Games are being held in bigger cities than they used to. To do so I made a chart:
But if I delete the outliers manually (2 observations - one for winter Olympics in Beijing in 2020 and The World Games in London), the chart looks like this:
The problem is that I want to include those points in the chart, but not for lm
calculation. Also I want it to be easy to read for people without statistical backgrounds, so I do not want to use different smoothing methods ( I saw an answer for loess smoothing R: How to remove outliers from a smoother in ggplot2? but that does not help in this case.
My sample code is:
ggplot(dane, aes(x = year, y = City_Size, col = IO_Type )) +
geom_jitter(size = 3) +
geom_smooth(method = lm, se = F, linetype = "dotted")