【发布时间】:2013-06-25 21:09:45
【问题描述】:
我有一个如下所示的数据集:
region expression species/gene
reg1 4 humanA
reg1 5 humanB
reg1 4 ratA
reg1 6 ratB
reg2 3 humanA
reg2 5 humanB
reg2 8 ratA
reg2 2 ratB
我想在 x 轴上绘制区域 1-n,在 y 轴上绘制表达式值,按物种/基因的值进行颜色编码。我还想通过每个物种/基因组绘制趋势线,并在边缘显示 r 值。理想情况下,我会使用某种格式
ggplot(data, aes(x=xvar, y=yvar)) +
geom_point(shape=1) +
geom_smooth(method=lm) +
geom_point(shape=19, alpha=1/4)
但我太笨了,无法弄清楚如何将它与我的数据纠缠在一起。提前致谢!
【问题讨论】:
标签: r ggplot2 regression scatter-plot