I hope someone can help me with my problem. I have this code
lot <- ggplot(x,aes(x$Emissions..kt.CO.eq..per.capita, x$brandstof.consumptie.in.ton)) +
scale_x_continuous("Emissies kt CO2-eq per capita") +
scale_y_continuous("energieconsumptie in transportsector per capita (ton)") +
geom_smooth(method = "lm") +
geom_text(hjust = 0, nudge_x = 0.5, size = 4, aes(label = x$landen))
But if I generate my plot, I get something very weird: the line won't fit the datapoints (see picture).
If I generate the plot without the geom_smooth()
function I get a nice plot.
I did already restart R, did it with other data. But it won't help.