################################################################ ## Initialization ################################################################ # context cleanup rm(list=ls()) ################################################################ ## Data Loading ################################################################ # load prices from file and compute returns table<-read.csv("SASM_30fundamentalist_70speculators_prices.dat", header=FALSE, sep=" ", dec=".") prices<-table$V2[5000:5400] date<-table$V1[5000:5400] day<-date # load world from file (optional) table_world<-read.csv("SASM_30fundamentalist_70speculators_world.dat", header=FALSE, sep=" ", dec=".") prices_world<-table_world$V2[5000:5400] date_world<-table_world$V1[5000:5400] ################################################################ ## General ################################################################ # prices and returns postscript(file="./images/SASM_bubble.eps", horizontal=FALSE, onefile=FALSE, width=10, height=10) par(cex=2.3) plot(day, prices, type="l", xlab="date", ylab="prices") lines(date_world, prices_world, type="l", col="red") dev.off()