在這之前我非常茫然,R中的統計過濾命令是如何實現的「卷積」方法。我理解過濾器爲1時的情況,但對於任何其他過濾器值的混淆。從計算器(simple examples of filter function, recursive option specifically)另外一個問題我的理解「迴旋」是如何工作的濾波器= 1 如:統計信息的工作::過濾函數R
f1<-1,f2<-1,f3<-1
x<-c(1:5)
filter(x,c(f1,f2))
3 5 7 9 NA
#which translates to
x[1]*f1+x[2]*f2
x[2]*f1+x[3]*f2
x[3]*f1+x[4]*f2
x[4]*f1+x[5]*f2
x[5]*f1+x[6]*f2 #x[6] is NA
#filter other than 1
#filter<-c(1,2)
filter(x,c(1,2))
4 7 10 13 NA
#and not the below ones
x[1]*f1+x[2]*f2=5
x[2]*f1+x[3]*f2=8
x[3]*f1+x[4]*f2=11
等等,究竟發生在這裏?這可能是微不足道的,因爲缺乏對卷積方法的理解,但我無法弄清楚。
要清楚,這不是'過濾器',而是'stats :: filter'。而不是'dplyr :: filter' – smci