[Blotter-commits] r897 - pkg/FinancialInstrument/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 30 16:56:26 CET 2011


Author: braverock
Date: 2011-12-30 16:56:26 +0100 (Fri, 30 Dec 2011)
New Revision: 897

Modified:
   pkg/FinancialInstrument/R/buildSpread.R
Log:
- use ncol rather than NCOL, fewer instructions, thanks Garrett

Modified: pkg/FinancialInstrument/R/buildSpread.R
===================================================================
--- pkg/FinancialInstrument/R/buildSpread.R	2011-12-30 06:53:21 UTC (rev 896)
+++ pkg/FinancialInstrument/R/buildSpread.R	2011-12-30 15:56:26 UTC (rev 897)
@@ -107,7 +107,7 @@
         if (!is.logical(instr_prices) || ncol(instr_prices) > 1) instr_prices <- getPrice(instr_prices,prefer=pref)
         if (instr$currency != spread_currency) 
             instr_prices <- redenominate(instr_prices,spread_currency,instr$currency)
-        if (NCOL(instr_prices) > 1) instr_prices <- getPrice(instr_prices, prefer=pref)
+        if (ncol(instr_prices) > 1) instr_prices <- getPrice(instr_prices, prefer=pref)
         instr_norm <- instr_prices * instr_mult * instr_ratio
         colnames(instr_norm) <- paste(as.character(spread_instr$members[i]), 
             prefer, sep = ".")



More information about the Blotter-commits mailing list