[Mboost-commits] r846 - pkg/mboostDevel/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 15 13:48:58 CEST 2015


Author: hofner
Date: 2015-04-15 13:48:58 +0200 (Wed, 15 Apr 2015)
New Revision: 846

Modified:
   pkg/mboostDevel/R/plot.R
Log:
(R/plot.R) bugfix with non-unique estimates for factors

Modified: pkg/mboostDevel/R/plot.R
===================================================================
--- pkg/mboostDevel/R/plot.R	2015-04-15 08:36:55 UTC (rev 845)
+++ pkg/mboostDevel/R/plot.R	2015-04-15 11:48:58 UTC (rev 846)
@@ -62,7 +62,12 @@
                     if (is.factor(data[[1]])) {
                         xVals <- unique(sort(data[[1]]))
                         xValsN <- as.numeric(xVals)
-                        yVals <- unique(pr[order(data[[1]], na.last = NA)])
+                        ## make sure that we get the same number of values as in
+                        ## x; this is only a problem if pr is equal for
+                        ## different x values.
+                        yVals <- unique(cbind(pr[order(data[[1]], na.last = NA)],
+                                              sort(data[[1]])))[, 1]
+
                         if (length(pr) == 1 && pr == 0) {
                             yVals <- rep(0, length(xVals))
                         }



More information about the Mboost-commits mailing list