[Depmix-commits] r418 - pkg/depmix/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 21 16:32:28 CEST 2010


Author: ingmarvisser
Date: 2010-06-21 16:32:28 +0200 (Mon, 21 Jun 2010)
New Revision: 418

Modified:
   pkg/depmix/R/depmix-internal.R
   pkg/depmix/R/depmix.R
Log:
Took care of (harmless) coercion warning (all(dc)) and added require("Rdonlp2") in using that method for optimization.

Modified: pkg/depmix/R/depmix-internal.R
===================================================================
--- pkg/depmix/R/depmix-internal.R	2010-06-03 12:27:14 UTC (rev 417)
+++ pkg/depmix/R/depmix-internal.R	2010-06-21 14:32:28 UTC (rev 418)
@@ -81,8 +81,8 @@
 			PACKAGE="depmix")
 		datset <- list()
 		for(i in 1:xgmod$ng) {
-			catit=0
-			dc=numeric(0)
+# 			catit=0
+# 			dc=numeric(0)
 			datset[[i]] <- .C("ngCovSetUp",
 				as.integer(i),
 				as.double(t(dcov[[i]])),
@@ -144,10 +144,9 @@
  				else dc[catit]=0
 			}
 		}
-		if(all(dc)) recdat=dat[[i]]
+		if(all(as.logical(dc))) recdat=dat[[i]]
 		else recdat=recode(dat[[i]],xm)
 		
-
 		datset[[i]] <- .C("ngDataSetUp",
 			as.integer(i),
 			as.double(t(recdat)),

Modified: pkg/depmix/R/depmix.R
===================================================================
--- pkg/depmix/R/depmix.R	2010-06-03 12:27:14 UTC (rev 417)
+++ pkg/depmix/R/depmix.R	2010-06-21 14:32:28 UTC (rev 418)
@@ -257,7 +257,9 @@
 	
 	##  call npmain to optimize the model (non-linear constraints not implemented yet)
 	if(method=="donlp") {
-			
+		
+		require("Rdonlp2")
+		
 		bu=bu[which(fixed==1)]
 		bl=bl[which(fixed==1)]
 		



More information about the depmix-commits mailing list