diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2011-10-09 21:31:30 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2011-10-09 21:31:30 -0400 |
| commit | e218b9cb3b5290028d5121ecdf0622fe3f78bad8 (patch) | |
| tree | f93bc8cbf4049e3f113dc6b1da053ee62622e041 | |
| parent | 146e3e1b1276c71d2467202b9aa85fbdc127d6eb (diff) | |
| download | bandit-e218b9cb3b5290028d5121ecdf0622fe3f78bad8.tar.gz | |
Small bug fix
| -rw-r--r-- | bandit.R | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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) - |
