files=c("A5M","A1H","A1D","B5M","B1H","B1D") tperiod=rep(c("5 minutes","1 hour","1 day"),2) tbits=c("10^9","10^12","10^12","10^12","10^15","10^15") ymin=c(0,0,15,0,0,100) ymax=c(300,3.5,45,3500,40,650) k2=c(1E9,1E12,1E12,1E12,1E15,1E15) # plot a time series according to ref. (source of data): # Cortez, P., Rio, M., Rocha, M., and Sousa, P. (2012). Multi-scale Internet traffic forecasting using neural networks and time series methods. Expert Systems, 29(2), 143-155, http://dx.doi.org/10.1111/j.1468-0394.2010.00568.x # if ifile=="" then the plot goes to the console, else it is saved in a PDF file mypdf=function(ts,ifile="",i) { if(ifile!="") pdf(file=paste(ifile,".pdf",sep="")) par(mar=c(4,4,4,1)) plot(ts/k2[i],type="l",ylim=c(ymin[i],ymax[i]),main=ifile,xlab=paste("time (x ",tperiod[i],")",sep=""),ylab=paste("x 10^",tbits[i],"bits",sep="")) if(ifile!="") dev.off() } ts=vector("list",length(files)) for(i in 1:length(files) ) #for(i in 1:1) { ts[[i]]=read.table(paste(files[i],".csv",sep=""),sep=";",header=FALSE)$V1 mypdf(ts[[i]],files[i],i) } # show all time series print(ts)