Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R stat_平滑所有点_R_Ggplot2 - Fatal编程技术网

R stat_平滑所有点

R stat_平滑所有点,r,ggplot2,R,Ggplot2,从,我有我的情节线 ggplot(plotData, aes(x, y, label=label, group=label)) + geom_line() + stat_smooth() 但这会使每行平滑一行。如何平滑所有数据点 ggplot(plotData, aes(x, y, label=label, group=label)) + geom_line() + geom_smooth(aes(group = 1)) 我应该这样做。这里的想法是提供一种新的组美学,使拟合

从,我有我的情节线

ggplot(plotData, aes(x, y, label=label, group=label)) + geom_line() + stat_smooth()
但这会使每行平滑一行。如何平滑所有数据点

ggplot(plotData, aes(x, y, label=label, group=label)) + 
    geom_line() +
    geom_smooth(aes(group = 1))
我应该这样做。这里的想法是提供一种新的组美学,使拟合的平滑器基于所有数据,而不是
group=label
美学

我提议的修改如下:

ggplot(plotData, aes(x, y, label=label, group=label)) + 
    geom_text() + 
    geom_smooth(aes(group = 1))
这将产生:


在过去的24小时里,你问了很多类似的问题。也许您可以从花多一点时间学习R教程中获益,例如和。