[Blotter-commits] r385 - pkg/blotter/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 3 16:09:02 CEST 2010


Author: braverock
Date: 2010-09-03 16:09:02 +0200 (Fri, 03 Sep 2010)
New Revision: 385

Modified:
   pkg/blotter/R/updatePortf.R
Log:
- apply patch for subset issue in some combinations of R/xts provided by Alex Bird

Modified: pkg/blotter/R/updatePortf.R
===================================================================
--- pkg/blotter/R/updatePortf.R	2010-09-03 13:06:31 UTC (rev 384)
+++ pkg/blotter/R/updatePortf.R	2010-09-03 14:09:02 UTC (rev 385)
@@ -76,7 +76,11 @@
 	if(!is.timeBased(Dates)) Dates = time(Portfolio$summary[Dates])
 	startDate = xts:::.parseISO8601(first(Dates))$first.time-1 #does this need to be a smaller delta for millisecond data?
 	# trim summary slot to not double count, related to bug 831 on R-Forge, and rbind new summary 
-	Portfolio$summary<-rbind(Portfolio$summary[paste('::',startDate,sep='')],summary)
+	if(attr(Portfolio,'initDate')>=startDate){
+		Portfolio$summary<-summary #changes to subset might not return a empty dimnames set of columns
+	}else{
+		Portfolio$summary<-rbind(Portfolio$summary[paste('::',startDate,sep='')],summary)
+	}
 	# assign Portfolio to environment
 	assign( paste("portfolio",pname,sep='.'), Portfolio, envir=.blotter )
 	



More information about the Blotter-commits mailing list