Diff of /R/jags.R [6f9420] .. [9885fe] Maximize Restore

  Switch to side-by-side view

--- a/R/jags.R
+++ b/R/jags.R
@@ -83,7 +83,7 @@
             warning("Unused variable \"", unused.variables[i], "\" in data")
         }
         ### Check for data frames
-        df <- which(sapply(data, is.data.frame))
+        df <- which(as.logical(sapply(data, is.data.frame)))
         for (i in seq(along=df)) {
             if (all(sapply(data[[df[i]]], is.numeric))) {
                 #Turn numeric data frames into matrices
@@ -94,6 +94,9 @@
                      names(data)[df[i]])
             }
         }
+    }
+    else if (is.null(data)) {
+        data <- list()
     }
     else {
         stop("data must be a list or environment")