将线性回归线添加到R

时间:2016-04-11 03:10:44

标签: r plot ggplot2 linear-regression graphing

我想在半对数点图中添加一个线性回归线,但我似乎无法使其工作。

  

mm = c(44.637,41.252,38.717,36.176,34.275,32.366,30.676,29.407,27.715,26.866)

     

bp = c(100,200,300,400,500,600,700,800,900,1000)

     

ladder = data.frame(mm,bp)

     

ggplot2.dotplot(data = ladder,xName =' bp',yName =' mm',mainTitle =' Ladder')+ scale_y_log10(breaks = trans_breaks (' log10',function(x)10 ^ x),labels = trans_format(' log10',math_format(10 ^ .x)))

我已尝试过> geom_smooth,> geom_abline和> stat_smooth。这些都不起作用。非常感谢帮助。

0 个答案:

没有答案