通过ggplot2的stat_smooth调整拟合线增量?

时间:2017-02-22 21:06:35

标签: r ggplot2 time-series increment

我正在使用ggplot2的stat_smooth的黄土方法来拟合我的数据。我原始数据的X增量为1年。然而,stat_smooth黄土的拟合线给了我X'增量为0.522。我想知道有没有办法调整stat_smooth返回的拟合线的增量?基本上,将X增量保持为原始长度。非常感谢!

print(ggplot(orig_data, aes(Year,Value, col=County)) + geom_point(na.rm = T) +
    stat_smooth(alpha=.2,size=1,se=F,method="loess",formula = y~x, span = 0.5,
      aes(outfit=fit<<-..y..,outx=fit_x<<-..x..)) + theme(legend.position="none"))

enter image description here

0 个答案:

没有答案