Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Adding a line through means using ggplot

$
0
0

I'm drawing a plot using the means grouping the data with two factors. As you can see I'm getting a vertical line but I want a line containing the points (One for each subplot). How can I do that?

ggplot(data = grouped.df, aes(x = jobclass, y = wage)) +
stat_summary(fun.y = "mean", geom = "point") + 
facet_wrap(~race) + geom_line()

enter image description here


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>