[r-cran-coda] 48/60: Imported Upstream version 0.18-1

Andreas Tille tille at debian.org
Fri Dec 16 12:11:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository r-cran-coda.

commit 9e48893fac28d4d682d7cdbb4cd4df17cc8af8d0
Author: Andreas Tille <tille at debian.org>
Date:   Fri Dec 16 12:10:03 2016 +0100

    Imported Upstream version 0.18-1
---
 CHANGELOG       |  15 +++++++++++
 DESCRIPTION     |  16 +++++++-----
 MD5             |  20 +++++++-------
 NAMESPACE       |  17 ++++++++----
 R/codamenu.R    |  16 ------------
 R/mcextractor.R |   8 ++++--
 R/mcmclist.R    |  80 ++++++++++++++++++++++++++++++++++++--------------------
 R/util.R        |   3 +--
 data/line.rda   | Bin 9600 -> 9600 bytes
 inst/AUTHORS    |  15 +++++++++--
 man/cumuplot.Rd |   4 +--
 11 files changed, 118 insertions(+), 76 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index d975c4c..1db2f67 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,18 @@
+0.18-1 Martyn Plummer <plummer at iarc.fr>
+
+	- Arni Magnusson is fully credited as coauthor
+
+	- Fixed bug in "varnames<-", which failed when the mcmc object was
+	not a matrix. Thanks to Evangelos Evangelou and Pavel Krivitsky.
+
+	- NAMESPACE file now includes imports of functions from base packages.
+
+	- codamenu no longer gives option to save mcmc object on exit.
+
+0.17-2 Martyn Plummer <plummerm at iarc.fr>
+
+	- Avoid redundant copies when subsetting mcmc.list objects
+
 0.17-1 Martyn Plummer <plummerm at iarc.fr>
 
 	- Moved lattice package from Depends to Imports in DESCRIPTION
diff --git a/DESCRIPTION b/DESCRIPTION
index 22e5648..b382d54 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: coda
-Version: 0.17-1
-Date: 2015-03-02
+Version: 0.18-1
+Date: 2015-10-16
 Title: Output Analysis and Diagnostics for MCMC
 Authors at R: c(person("Martyn", "Plummer", role=c("aut","cre","trl"),
        	            email="plummerm at iarc.fr"),
@@ -9,7 +9,8 @@ Authors at R: c(person("Martyn", "Plummer", role=c("aut","cre","trl"),
              person("Karen", "Vines", role="aut"),
              person("Deepayan", "Sarkar", role="aut"),
 	     person("Douglas", "Bates", role="aut"),
-             person("Russell", "Almond", role="aut"))
+             person("Russell", "Almond", role="aut"),
+	     person("Arni", "Magnusson", role="aut"))
 Depends: R (>= 2.14.0)
 Imports: lattice
 Description: Provides functions for summarizing and plotting the
@@ -17,15 +18,16 @@ Description: Provides functions for summarizing and plotting the
 	well as diagnostic tests of convergence to the equilibrium
 	distribution of the Markov chain.
 License: GPL (>= 2)
-Packaged: 2015-03-03 17:21:11 UTC; martyn
+NeedsCompilation: no
+Packaged: 2015-10-16 14:52:42 UTC; martyn
 Author: Martyn Plummer [aut, cre, trl],
   Nicky Best [aut],
   Kate Cowles [aut],
   Karen Vines [aut],
   Deepayan Sarkar [aut],
   Douglas Bates [aut],
-  Russell Almond [aut]
+  Russell Almond [aut],
+  Arni Magnusson [aut]
 Maintainer: Martyn Plummer <plummerm at iarc.fr>
-NeedsCompilation: no
 Repository: CRAN
-Date/Publication: 2015-03-03 19:25:43
+Date/Publication: 2015-10-16 20:00:43
diff --git a/MD5 b/MD5
index ab4b1ee..066cbe3 100644
--- a/MD5
+++ b/MD5
@@ -1,28 +1,28 @@
-370fb32c3079904dfc365e55676f04d5 *CHANGELOG
-8bb04518c5614ce417d2ec9ee3fc45de *DESCRIPTION
+5d573790477b5f532496ced708cf98b1 *CHANGELOG
+ee63dce424da3eb1d6694384207193d5 *DESCRIPTION
 ff890b50eaa074ed668c6f2fac1b4141 *INDEX
-adcc371105f44cfe439cd60f8ff727d4 *NAMESPACE
+201d6ba76723e5bc6a9a51df4d7f99a3 *NAMESPACE
 45f88adec7bcfab586a4deebba1cc02d *R/HPDinterval.R
 841853b3b96462cffe376cf9fad6abb9 *R/autocorrdiag.R
 02152920c66f540422f88e51c88f0428 *R/batchSE.R
-a22da830a261cd0f28da6052c560d5df *R/codamenu.R
+4e1a55cb0aed5bcaa0f2f9d474e2fdea *R/codamenu.R
 df4c85619867ba81878499f5059e875d *R/cumuplot.R
 7403a684ac51932afbbb617d1f606a9a *R/gelman.R
 a97024cb207bcef6fd4bc7c00283c1ed *R/geweke.R
 6fb74d6977e5e3b5190eda35829cdc23 *R/heidel.R
 ae77a3ec34f086bd7ec8ea787baeeb1e *R/jags.R
-f3b382582d73aad54d77c4c655513c58 *R/mcextractor.R
+0473eacf2812c4d9641e1c7fd09056b4 *R/mcextractor.R
 97fef151be1d2924942ca84de70c87f4 *R/mcmc.R
-36759e063fe91197b2ef29b4b288eaee *R/mcmclist.R
+f60ceb305b2ab088484ab63d938333d1 *R/mcmclist.R
 bd120c9296e4467265ee10409799e61f *R/output.R
 389758882050a375ac4b5298a42ae35f *R/raftery.R
 4caafbeb9941605b240d3ae9f6c8d5ff *R/rejectionRate.R
 d41d8cd98f00b204e9800998ecf8427e *R/thin.R
 553b1effc0816a68e0ad4dfd7847757f *R/trellisplots.R
-ffc99e7d181a7308c8aef6ea059a8d51 *R/util.R
+1e363c43c22c2a0e9658866463a0542d *R/util.R
 4d7d828d6d2b4fee5357d3a4dd108458 *README
-2d8879e17e372a474e9c9c1057129b02 *data/line.rda
-3ad76246334ca13bb7cba54ce71e48bd *inst/AUTHORS
+ff0a8b17ed6881971cbd33c7ddb3fbda *data/line.rda
+52066ed7a20504a282a091060a794d57 *inst/AUTHORS
 81c1ae300d47f9a787eb871fbaafeb9f *inst/CITATION
 868ded8f4d10a67c7b31854bce6f3d63 *man/Cramer.Rd
 7bfe602ce737efac910300e5be5a8552 *man/HPDinterval.Rd
@@ -36,7 +36,7 @@ e704de229cf312aa584094b126529e1a *man/coda.options.Rd
 04dd4994917068f5d36fbcff921deb7f *man/codamenu.Rd
 d3b21ba8f4c82fd92adfb1d4380d4cc8 *man/crosscorr.Rd
 80c2893a13683e442443b36764810498 *man/crosscorr.plot.Rd
-2cc5efe9b602aae1ad07e0f7266142b6 *man/cumuplot.Rd
+18609dc8a896f624c979de557280cbf0 *man/cumuplot.Rd
 14365306d891deafd1ca602f59e4520f *man/densplot.Rd
 2b5bbbb8d683384c9287a9c8e1f7a01f *man/effectiveSize.Rd
 c78c35ac982bcd74befe51f98ba641e4 *man/gelman.diag.Rd
diff --git a/NAMESPACE b/NAMESPACE
index 4230d13..4485dc2 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -123,11 +123,18 @@ S3method(print, raftery.diag)
 S3method(print, summary.mcmc)
 
 ## Imports
-importFrom(stats, start, end, frequency, time, window, as.ts)
-importFrom(lattice, xyplot, qqmath, densityplot, levelplot, panel.abline,
-           panel.xyplot, trellis.par.get, do.breaks, panel.superpose,
-           prepanel.qqmathline, splom)
-importFrom(utils, head, tail)
+
+importFrom(grDevices, dev.cur, dev.interactive, dev.off, postscript,
+           topo.colors)
+importFrom(graphics, abline, axis, hist, legend, lines, matplot, par,
+           plot, polygon, text, title)
+importFrom(lattice, xyplot, qqmath, densityplot, levelplot,
+           panel.abline, panel.xyplot, trellis.par.get, do.breaks,
+           panel.superpose, prepanel.qqmathline, splom)
+importFrom(stats, Gamma, IQR, acf, aggregate, ar, as.formula, as.ts,
+           cor, density, end, fft, frequency, glm, lm, lowess, predict, qf,
+           qnorm, quantile, residuals, sd, start, time, ts, var, window)
+importFrom(utils, head, menu, read.table, tail)
 
 ## lattice methods
 
diff --git a/R/codamenu.R b/R/codamenu.R
index cb48d09..e77b13c 100644
--- a/R/codamenu.R
+++ b/R/codamenu.R
@@ -12,7 +12,6 @@
     if (is.null(coda.dat)) {
       return(invisible())
     }
-    coda.options(data.saved = FALSE)
   }
   else if (pick == 2) {
     msg <- "\nEnter name of saved object (or type \"exit\" to quit)"
@@ -45,8 +44,6 @@
   if (is.matrix(coda.dat[[1]]) && is.null(varnames(coda.dat))) {
     varnames(coda.dat) <- varnames(coda.dat, allow.null = FALSE)
   }
-  on.exit(tidy.up(coda.dat))
-
   
   ## Check for variables that are linear functions of the
   ## iteration number
@@ -874,19 +871,6 @@ function (last.menu)
   return(mcmc.list(chains))
 }
 
-"tidy.up" <- function (data) 
-{
-  cat("\nQuitting codamenu ...\n")
-  if (!coda.options("data.saved")) {
-    ans <- read.yesno("Do you want to save the mcmc output", default=FALSE)
-    if (ans == TRUE) {
-      cat("Enter name you want to call this object:\n")
-      fname <- scan(what = character(), nmax = 1, strip.white = TRUE)
-      assign(fname, data, pos=1)
-    }
-  }
-}
-
 "codamenu.ps" <- function () 
 {
   if (names(dev.cur()) == "postscript") {
diff --git a/R/mcextractor.R b/R/mcextractor.R
index 47c52c8..4829aa4 100644
--- a/R/mcextractor.R
+++ b/R/mcextractor.R
@@ -38,10 +38,14 @@ function (x, allow.null = TRUE)
 function (x, value) 
 {
     if (is.mcmc(x)) {
-        dimnames(x)[[2]] <- value
+        if (length(dim(x)) < 2) {
+            dim(x) <- c(length(x), 1)
+        }
+        colnames(x) <- value
     }
-    else if (is.mcmc.list(x)) 
+    else if (is.mcmc.list(x)) {
         for (i in 1:nchain(x)) varnames(x[[i]]) <- value
+    }
     else stop("Not an mcmc or mcmc.list object")
     x
 }
diff --git a/R/mcmclist.R b/R/mcmclist.R
index 852032c..cfbd265 100644
--- a/R/mcmclist.R
+++ b/R/mcmclist.R
@@ -1,39 +1,61 @@
 "[.mcmc.list" <- function (x, i, j, drop = TRUE) 
 {
-  ## In S-PLUS the code is altered so that the user can
-  ## pick out particular parameters by calling mcmc.obj[,c("param1", "param2")]
+    ## In S-PLUS the code is altered so that the user can
+    ## pick out particular parameters by calling
+    ## mcmc.obj[,c("param1", "param2")]
   
-  ## Trying to squeeze too much functionality in here
-  ## x[p:q] will subset the list
-  ## x[p,], x[,q], x[p,q] will be recursively applied to
-  ## the elements of the list, even if they are vectors
-  if (nargs() < 3 + !missing(drop)) {
-    ## Subset the list
-    if (is.R()) {
-      y <- NextMethod("[")
+    ## Trying to squeeze too much functionality in here
+    ## x[p:q] will subset the list
+    ## x[p,], x[,q], x[p,q] will be recursively applied to
+    ## the elements of the list, even if they are vectors
+
+    if (nargs() < 3 + !missing(drop)) {
+        ## Subset the list
+        if (is.R()) {
+            y <- NextMethod("[")
+        }
+        else {
+            y <- as.matrix(x)[i,j]
+        }
     }
     else {
-      y <- as.matrix(x)[i,j]
+        ## Subset the elements of the list
+        y <- vector("list", length(x))
+        names(y) <- names(x)
+        for (k in 1:length(y)) {
+            y[[k]] <- if (missing(i) && missing(j)) {
+                    x[[k]]
+            }
+            else if (is.matrix(x[[k]])) {
+                if (missing(i)) {
+                    x[[k]][, j, drop = drop]
+                }
+                else if (missing(j)) {
+                    x[[k]][i, , drop = drop]
+                }
+                else {
+                    x[[k]][i, j, drop = drop]
+                }
+            }
+            else {
+                ### Coerce x[[k]] to matrix before subsetting
+                z <- as.matrix.mcmc(x[[k]])
+                if (missing(i)) {
+                    mcmc(z[, j, drop = TRUE], start(x), end(x), thin(x))
+                }
+                else if (missing(j)) {
+                    z[i, , drop = TRUE]
+                }
+                else {
+                    z[i, j, drop = TRUE]
+                }
+            }
+        }
     }
-  }
-  else {
-    ## Subset the elements of the list
-    y <- vector("list", length(x))
-    names(y) <- names(x)
-    for (k in 1:length(y)) {
-      drop1 <- drop | !is.matrix(x[[k]])
-      y[[k]] <- if (missing(i) && missing(j)) 
-        x[[k]]
-      else if (missing(i))
-        mcmc(as.matrix(x[[k]])[, j, drop = drop1], start(x), end(x), thin(x))
-      else if (missing(j)) 
-        as.matrix(x[[k]])[i, , drop = drop1]
-      else as.matrix(x[[k]])[i, j, drop = drop1]
+    if (is.list(y) && all(sapply(y, is.mcmc, simplify = TRUE))) {
+        y <- mcmc.list(y)
     }
-  }
-  if (is.list(y) && all(sapply(y, is.mcmc, simplify = TRUE))) 
-    y <- mcmc.list(y)
-  return(y)
+    return(y)
 }
 
 
diff --git a/R/util.R b/R/util.R
index 4644e25..7285315 100644
--- a/R/util.R
+++ b/R/util.R
@@ -244,8 +244,7 @@ function (...)
        user.layout = FALSE,
        gr.bin = 10,
        geweke.nbin = 20,
-       gr.max = 50,
-       data.saved = TRUE
+       gr.max = 50
        )
 
 coda.env <- new.env()
diff --git a/data/line.rda b/data/line.rda
index 815e8b2..960a9f6 100644
Binary files a/data/line.rda and b/data/line.rda differ
diff --git a/inst/AUTHORS b/inst/AUTHORS
index 50ce339..abc4ee6 100644
--- a/inst/AUTHORS
+++ b/inst/AUTHORS
@@ -21,6 +21,19 @@ so that the user is not bound by the menu-driven interface.
 All authors, and the MRC Biostatistic Unit, have given permission for
 the license terms to be changed to GPL.
 
+Other authors of CODA
+---------------------
+
+Deepayan Sarkar provided lattice graphics functions (See ?densityplot.mcmc)
+
+Douglas Bates wrote the HPDinterval function.
+
+Russell Almond <almond at acm.org>, <ralmond at ets.org> provided a number
+of cleanups and wrote the functions autocorr.diag, batchSE, and
+rejectionRate.
+
+Arni Magnusson wrote the cumuplot function.
+
 Further credits
 ---------------
 
@@ -35,5 +48,3 @@ contributed to the Statlib archive by Steven Lewis
 Andrew Martin <admartin at wustl.edu> added namespace facilities and
 fixed a large number of bugs that this change uncovered (see CHANGELOG)
 
-Russell Almond <almond at acm.org>, <ralmond at ets.org> provided a number
-of cleanups and additions (see CHANGELOG).
diff --git a/man/cumuplot.Rd b/man/cumuplot.Rd
index 7603461..0a94310 100644
--- a/man/cumuplot.Rd
+++ b/man/cumuplot.Rd
@@ -25,7 +25,5 @@
   number of iterations.
 }
   
-\author{
-  Arni Magnusson 
-}
+\author{Arni Magnusson}
 \keyword{hplot}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-coda.git



More information about the debian-science-commits mailing list