Hi all,
I have a datset, which I want to plot:
Percentage_low_income / Distance / City
50.8 /5/ Amsterdam
50.9 /10/ Amsterdam
45.5 /Municipality/ Amsterdam
53.1 /5 / Rotterdam
53.1 /10/ Rotterdam
39 /Municipality/ Rotterdam
51.6 5 The_Hague
50.1 10 The_Hague
36.7 Municipality The_Hague
48.1 5 Utrecht
48 10 Utrecht
40.5 Municipality Utrecht
50.6 5 Total
50.5 10 Total
40 Municipality Total
I want to have the Distance on the x-axis, the percentage on the y-axis and the cities as colour. But, to increase the readability of the graph I also want to include smooth lines that go through all three points per city. My code:
ggplot(data = dat, mapping = aes(x = Distance,
y = Percentage_low_income,
color = City)) +
geom_point() +
geom_smooth(method = "auto", se = FALSE)
However, it does not seem to plot the smooth lines, can anyone help me out?