在时间序列中添加过滤器(平滑线)

时间:2018-02-09 16:26:26

标签: r ggplot2 filter time-series

我创建了这个时间序列。你可以看到它有点混乱。

enter image description here

我使用了这段代码:

Stations$Code
Data[,1] = as.Date(Data[,1],format="%Y-%m-%d")
class(Data$Date)

ggplot(Data, aes(x = Date)) + 
  geom_line(aes(y = AT31204), colour="yellow") + 
  geom_line(aes(y = ES1498A), colour = "orange") + 
  geom_line(aes(y = FR15044), colour = "red") + 
  geom_line(aes(y = FR09003), colour = "purple") + 
  geom_line(aes(y = ES1358A), colour = "blue") + 
  geom_line(aes(y = DEBW076), colour = "green") + 
  geom_line(aes(y = FR15044), colour = "brown") + 
  guides(colour = guide_legend) +
  ylab(label="Ozon µg/m3") + 
  xlab("Time")

如何创建更平滑的线条(一条线用于一个电台)?我想的只是采取了几个月的平均值,但有没有其他方法可以在情节中自动完成?

0 个答案:

没有答案
相关问题