[Blotter-commits] r723 - pkg/FinancialInstrument/sandbox
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Aug 9 23:09:11 CEST 2011
Author: braverock
Date: 2011-08-09 23:09:10 +0200 (Tue, 09 Aug 2011)
New Revision: 723
Modified:
pkg/FinancialInstrument/sandbox/TRTH_BackFill.R
Log:
- imporove default instrument type selection
Modified: pkg/FinancialInstrument/sandbox/TRTH_BackFill.R
===================================================================
--- pkg/FinancialInstrument/sandbox/TRTH_BackFill.R 2011-08-09 02:03:23 UTC (rev 722)
+++ pkg/FinancialInstrument/sandbox/TRTH_BackFill.R 2011-08-09 21:09:10 UTC (rev 723)
@@ -192,10 +192,10 @@
for(i in 1:length(instr_s)){
instr<-getInstrument(instr_s[i])
if(is.instrument(instr)){
- files.xts[grep(instr_s[i],files.xts[,'name.new']),'type']<-as.character(instr$type[1])
+ files.xts['name.new'==instr_s,'type']<-as.character(instr$type[1])
} else {
- print(instr, 'does not appear to be an instrument, setting it to', default_type)
- files.xts[grep(instr_s[i],files.xts[,'name.new']),'type']<-default_type
+ print(paste(instr_s[i], 'does not appear to be an instrument, setting it to', default_type))
+ files.xts['name.new'==instr_s,'type']<-default_type
}
}
More information about the Blotter-commits
mailing list