R-alpha: various small points

Martyn Plummer (plummer@iarc.fr)
Mon, 03 Feb 1997 10:09:10 +0100


Message-Id: <199702030936.KAA13794@hypatia.math.ethz.ch>
Date: Mon, 03 Feb 1997 10:09:10 +0100
To: r-testers@stat.math.ethz.ch
From: Martyn Plummer <plummer@iarc.fr>
Subject: R-alpha: various small points

I've been trawling through the code of CODA (MCMC output analysis
program which runs on S-PLUS) trying to get it to run under R.
I have accumulated a list of small points:

1) Bug
The following program will cause a core dump. It should generate
an error message.

do <- function() {
        x <- character(0)
        exists(x)
}

2) Incompatibility
The S-PLUS version of nchar will return a matrix when given a matrix,
whereas the R version returns a vector. This can be easily fixed in
the interpreted code by preserving the dim and dimnames attributes of
the input, but there may be a more elegant way of doing it.

nchar <- function (x)
{
        x <- as.character(x)
        y <- .Internal(nchar(x))
        dim(y) <- dim(x)
        dimnames(y) <- dimnames(x)
        return(y)
}

3) Incompatibility
It would be nice to be able to pass graphical parameters to
plotting functions. For example I'm having trouble with calls to 
"legend" in CODA which use the "cex" parameter.

4) Wish
Could we have an Inf object in R? I would find it useful.

5) Wish
It would be really nice to have a verbose mode for the debug function,
which steps through each line automatically while printing each
line to the screen. Currently I have to step through each line
with the return key just to see where CODA crashes.  This can
get very tedious as its a huge program.

Martyn

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-