Geir Olve Storvik wrote:>
> I have successfully installed coda in R, and I am also able to read
> output from a Bugs run into
> coda. When I try to plots from CODA Output Analysis Menu, I do however
> _get_ problems:
> CODA Output Analysis Menu
> *************************
>
> 1:Plots
> 2:Statistics
> 3:List/Change Options
> 4:Return to Main Menu
> Selection: 1
> Error: "missing" illegal use of missing
>
> Quitting CODA....
>
> Do you want to save the BUGS output as an R object file(y/n) ?
> 1:
>
> I tried to use the same data in the Splus version of coda, and that
> worked fine.
> I have also got the same type of problem with coda in R with output from
> a completely different model.
>
Geir,
I had the same problem and got it fixed by adding an additional argument
"bwf" to the "densplot" function like this:
"densplot" <-function (x, combine.chains = F, bwf)
{
x <- as.mcmc(x)
# *** Argument bwf required do.densplot <- function(j, i) {
# Like the next line
do.densplot <- function(j, i, bwf) {
#NB Using R scoping rules
#
if (missing(i))
y <- as.vector(x[, j, , drop = T])
else y <- as.vector(x[, j, i, drop = T])
y.orig <- y
# *** R complains about the next line, "illegal use of missing"
if (missing(bwf)) {
N <- length(!is.na(y))
bw <- 1.06 * min(sd(y), IQR(y)/1.34) *
N^-0.2
}
else {
bw <- bwf(y)
if (bw == 0)
bw <- 0.1
}
...
There are a couple of other bugs, too.
I have notified the author/maintainer of the package and according to
him, it may be due to changes in R between 0.62 and 0.63 and he is
trying to look at the problem.
Regards,
ST
--
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._