I have some data which looks like:
sample diff chromosome haploid coverage
B 90.9963099631 7 b 0.513
A 91.7019475021 12 a 8.234
C 90.3855783676 14 a 6.211
D 91.3407821229 17 b 4.321
E 91.5740740741 11 b 0.213
F 90.9963099631 7 b 0.513
G 91.7019475021 12 a 8.234
H 90.3855783676 14 a 6.211
I 91.3407821229 17 b 4.321
J 91.5740740741 11 b 0.213
And I want to visualise the change for 'diff' for different coverage value, across different chromosomes, so I did this:
plot = ggplot(dat, aes(x = coverage, y = diff, group = chromosome, colour = chromosome, ylim(0, 100)) ) + geom_point(colour = chromosome) + stat_smooth(se=FALSE) + ylim(0, 100)
`geom_smooth()` using method = 'loess'
Now I think this isn't the best way to draw mutliple trendlines, but I produced this:
Which is kind of what I'm after. But I think in reality, all the curves shouldn't be exactly the same shape given my data, but the shape of all of them is basically identical. So has geom_smooth() plot a single LOWESS curve for all categories and then just shifted the same curve up and down for different categories?
If so, is there a way to make it plot independent lines for each category?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…