From Kurt.Hornik@ci.tuwien.ac.at  Tue Apr  8 19:03:01 1997
From: Kurt.Hornik@ci.tuwien.ac.at (Kurt Hornik)
Date: Tue, 8 Apr 1997 20:03:01 +0200
Subject: R-alpha: jpn() port
Message-ID: <199704081803.UAA13610@aragorn.ci.tuwien.ac.at>

I've just completing porting the S jpn package to R (available in CRAN's
source/contrib).

Some remarks:

* It seems that S allows recycling when subscripting with logicals, but
R does not.  E.g.,

R> x <- 1:5
R> x
[1] 1 2 3 4 5
R> i <- c(F, T)
R> x[i]
Error: invalid subscript type
R>

In S, this is treated as x[rep(i, length = length(x))].

* It also seems that S does not worry about excluding subscripts which
are out of bounds.  In the above, x[-6] would give x, but in R

R> x[-6]
Error: subscript out of bounds

Just wanted to point that out ...

The jpn package contains VARIABLES (``data'') as well as functions, and
I guess it is the first one to do so.  Because we don't have `data'
grouped similar to `help' yet, the data are now directly in the R
`source'.

A problem occurs when documenting such data sets ... is there a nice way
of saying that something is a list with components
	a ....
	b ...
	c ...
using the R doc format?

Finally, here's something that's also been on my mind for some time now
(and also needed help in the port).  Code like

	if(all(names(x)) == c("x", "y"))

fails if names(x) is NULL.  Is that really necessary?  (More precisely,
obviously we only want to test whether the two objects have equal
values, a la Lisp `equal').

-k
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel 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-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: jpn() port
Kurt Hornik