Re: R-alpha: Misc problems

Martin Maechler (maechler@stat.math.ethz.ch)
Mon, 17 Feb 97 15:07:04 +0100


Date: Mon, 17 Feb 97 15:07:04 +0100
Message-Id: <9702171407.AA00523@>
From: Martin Maechler <maechler@stat.math.ethz.ch>
To: jlindsey@luc.ac.be
In-Reply-To: <9702170749.AA03020@alpha.luc.ac.be> (message from Jim Lindsey on
Subject: Re: R-alpha: Misc problems

>>>>> "Jim" == Jim Lindsey <jlindsey@luc.ac.be> writes:

    Jim> 1. The S books often give examples using something like this:
    Jim>   u <- list()
    Jim>   u[[1]] <- a

    Jim> In R this gives subscript out of bounds (also character, vector, etc.)

I think that R is okay here;
Why using unnamed lists anyway?
In the above example, you can do

	u $ a.name  <-  a

A similar issue (which was discussed on this list a while ago):

	x    <- 1:4
	x[6] <- 6

works in S, but not in R.
The decision was that R should help you to detect programming errors.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-