I'm trying to connect specific data points in ggplot, and geom_line is not working. I've tried:
ggplot(df, aes(x=x, y=y, color=V1)) +
geom_point(data = df, aes(x, y)) +
geom_line(aes(group = V1))
Here's my data:
V1 V2
1a 4
1b 6
1c 5
1d 6
1e 6
1f 6
2a 9
2b 7
2c 8
2d 4
2e 6
2f 5
3a 4
3b 8
3c 6
3d 5
3e 7
3f 6
What I'd like to do is create three separate lines. Each one connecting the V2 point 1c to point 1f (5 to 6), 2c to 2f (8 to 5), and 3c to 3f (6 to 6), but no lines connecting any of the a/d or b/e values in V1. Any suggestions?
