[Depmix-commits] r253 - trunk/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 18 12:17:00 CET 2009


Author: ingmarvisser
Date: 2009-02-18 12:16:59 +0100 (Wed, 18 Feb 2009)
New Revision: 253

Modified:
   trunk/R/freepars.R
Log:
Fixed bug in nlin (bug nr 309), working correctly now, revision 253

Modified: trunk/R/freepars.R
===================================================================
--- trunk/R/freepars.R	2009-02-18 10:28:06 UTC (rev 252)
+++ trunk/R/freepars.R	2009-02-18 11:16:59 UTC (rev 253)
@@ -26,14 +26,18 @@
 
 setMethod("nlin","mix.fitted",
 	function(object) {
-		nlin <- qr(object at conMat[which(object at lin.lower==object at lin.upper),,drop=FALSE])$rank
+		conMat <- object at conMat[which(object at lin.lower==object at lin.upper),,drop=FALSE]
+		if(nrow(conMat==0) nlin <- 0 
+		else nlin <- qr(conMat)$rank
 		nlin
 	}
 )
 
 setMethod("nlin","depmix.fitted",
 	function(object) {
-		nlin <- qr(object at conMat[which(object at lin.lower==object at lin.upper),,drop=FALSE])$rank
+		conMat <- object at conMat[which(object at lin.lower==object at lin.upper),,drop=FALSE]
+		if(nrow(conMat==0) nlin <- 0 
+		else nlin <- qr(conMat)$rank
 		nlin
 	}
 )


More information about the depmix-commits mailing list