Skip to content
Prev 5351 / 63424 Next

replicating lists

On Thu, 12 Apr 2001, Jonathan Rougier wrote:

            
We follow the prototype in cases of doubt, so version 3.  *However*,
S-PLUS does different things by version, so version 6.0 drops the
duplicated names.  I really think only 3 makes sense: a list is a generic
vector, and you do exactly the same thing as for any other sort of vector.
The only issue is the names, and

x <- letters[1:3]
names(x) <- x
rep(x, 5)

drops names in S+6.0, keeps them in S+3.4 and R.  So the S-PLUS versions
are doing consistent things with character vectors and lists.

As for array, again it fits with all other sorts of vectors.   I think you
are misconceiving what a list is: think of it as a vector with
components of different types.  An array list is just an array with
elements of different types.  The problems you had with [[1, ]] stem from
the same problem,