1 2 3 4 5 6 7 8 9 10 11 12 13 14
| RR<-read.csv2("RRmt.csv",sep="\t",dec=",")#je lis mon fichier csv
RR<-ts(RR,frequency=12,start=c(1962,1)) #je transforme en serie temporelle
plot(RR)
library(mFilter)#je charge mon package
opar<-par(no.readonly=TRUE)
RR.bw<-bwfilter(RR)
plot(RR.bw)
RR.bw1<-bwfilter(RR,drift=TRUE)
RR.bw2<-bwfilter(RR,freq=12,drift=TRUE)
RR.bw3<-bwfilter(RR,freq=48,drift=TRUE)
par(mfrow=c(2,1),mar=c(3,3,2,1),cex=.8)
plot(RR.bw1$x,main="Butterworth filter of precipitation: Trend,drift=TRUE",col=1,ylab="")
lines(RR.bw2$trend,col=3)
lines(RR.bw3$trend,col=4) |