[Depmix-commits] r571 - pkg/depmixS4/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Oct 2 12:27:44 CEST 2012


Author: maarten
Date: 2012-10-02 12:27:44 +0200 (Tue, 02 Oct 2012)
New Revision: 571

Modified:
   pkg/depmixS4/R/depmix-class.R
Log:
- fixed bug in summary.depmix compact (length was incorrect when names returns NULL for unnamed parameter vectors)

Modified: pkg/depmixS4/R/depmix-class.R
===================================================================
--- pkg/depmixS4/R/depmix-class.R	2012-09-25 10:05:57 UTC (rev 570)
+++ pkg/depmixS4/R/depmix-class.R	2012-10-02 10:27:44 UTC (rev 571)
@@ -409,6 +409,7 @@
 						} else {
 								cat("Response parameters \n")
 								for(j in 1:object at nresp) {
+								    # FIXME: responses can have different families too!
 										if("family" %in% slotNames(object at response[[1]][[j]])) cat("Resp",j, ":", object at response[[1]][[j]]@family$family, "\n")
 								}
 								pars <- list()
@@ -421,9 +422,9 @@
 								    nms <- character()
 								    for(i in 1:ns) {
 								        tnms <- names(getpars(object at response[[i]][[j]]))
-												if(is.null(tnms)) tnms=""
+												if(is.null(tnms)) tnms=rep("",length=length(getpars(object at response[[i]][[j]])))
 								        if(any(tnms == "")) {
-								            tnms[tnms == ""] <- paste("noname",1:sum(tnms == ""),sep="") # assume unnamed parameters are the same between
+								            tnms[tnms == ""] <- paste("anonym",1:sum(tnms == ""),sep="") # assume unnamed parameters are the same between states
 								        }
 								        parnames[[j]][[i]] <- tnms
 								        nms <- c(nms,tnms)



More information about the depmix-commits mailing list