[Distr-commits] r959 - in branches/distr-2.6/pkg: distr/R distrMod/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 12 14:45:39 CEST 2014


Author: ruckdeschel
Date: 2014-08-12 14:45:39 +0200 (Tue, 12 Aug 2014)
New Revision: 959

Modified:
   branches/distr-2.6/pkg/distr/R/internalUtils.R
   branches/distr-2.6/pkg/distrMod/R/0distrModUtils.R
Log:
[distr,distrMod] modified treatment of NULL in .fillList-utility

Modified: branches/distr-2.6/pkg/distr/R/internalUtils.R
===================================================================
--- branches/distr-2.6/pkg/distr/R/internalUtils.R	2014-08-10 17:26:21 UTC (rev 958)
+++ branches/distr-2.6/pkg/distr/R/internalUtils.R	2014-08-12 12:45:39 UTC (rev 959)
@@ -1236,19 +1236,21 @@
 .List <- function(list0) if(is.list(list0)) list0 else list(list0)
 
 .fillList <- function(list0, len = length(list0)){
+            if(is.null(list0)) return(vector("list",len))
             list0 <- .List(list0)
             if(len == length(list0)) 
                return(list0)
             i <- 0
             ll0 <- length(list0)
             li0 <- vector("list",len)
-            if(ll0)
-            while(i < len){
-               j <- 1 + ( i %% ll0)
-               i <- i + 1
-               li0[[i]] <- list0[[j]]
+            if(ll0){
+              while(i < len){
+                 j <- 1 + ( i %% ll0)
+                 i <- i + 1
+                 li0[[i]] <- list0[[j]]
+              }
             }
-           return(li0)
+            return(li0)
 }
 
 #------------------------------------------------------------------------------

Modified: branches/distr-2.6/pkg/distrMod/R/0distrModUtils.R
===================================================================
--- branches/distr-2.6/pkg/distrMod/R/0distrModUtils.R	2014-08-10 17:26:21 UTC (rev 958)
+++ branches/distr-2.6/pkg/distrMod/R/0distrModUtils.R	2014-08-12 12:45:39 UTC (rev 959)
@@ -430,6 +430,7 @@
 .List <- function(list0) if(is.list(list0)) list0 else list(list0)
 
 .fillList <- function(list0, len = length(list0)){
+            if(is.null(list0)) return(vector("list",len))
             list0 <- .List(list0)
             if(len == length(list0))
                return(list0)



More information about the Distr-commits mailing list