From e218b9cb3b5290028d5121ecdf0622fe3f78bad8 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Sun, 9 Oct 2011 21:31:30 -0400 Subject: Small bug fix --- bandit.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'bandit.R') diff --git a/bandit.R b/bandit.R index 1acb59a..a1b9703 100644 --- a/bandit.R +++ b/bandit.R @@ -51,8 +51,7 @@ for(day in 1:length(returns[,1])){ indexchange <- read.table("IndexChange_500.csv",sep="\t",header=T,quote="", colClasses="character") #cleanup tickers -attach(indexchange) -indexchange$Ticker.add <<- sub('/', '-',indexchange$Ticker.add) +indexchange$Ticker.add <- sub('/', '-',indexchange$Ticker.add) indexchange$Ticker.add <- sub('.wi', '',indexchange$Ticker.add,fixed=T) indexchange$Ticker.add <- sub('wi', '',indexchange$Ticker.add) indexchange$Ticker.add <- sub('.', '-',indexchange$Ticker.add,fixed=T) @@ -71,6 +70,7 @@ for( i in 1:100){ sp500.historic[-match(indexchange$Ticker.add[i],sp500.historic$ticker),] }else{ cat(paste("ticker",indexchange$Ticker.add[i],"not found\n")) + next() } } #add ticker that was removed @@ -80,5 +80,3 @@ for( i in 1:100){ indexchange$Ticker.del[i])) } } -detach(indexchange) - -- cgit v1.2.3-70-g09d2