Inline below ...
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<[email protected]>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

JulioSergio <[email protected]> wrote:

>Bert Gunter <gunter.berton <at> gene.com> writes:
>
>> 
>> Inline Below.
>
>Well, Bert, then the manual where I found the example must be wrong. It
>is:
>
>http://cran.r-project.org/doc/manuals/R-intro.html#Constructing-and-modifying-
>lists
>
>And textually it says:
>
>Lists, like any subscripted object, can be extended by specifying
>additional 
>components. For example
>
>     > Lst[5] <- list(matrix=Mat)

It may be true that the example is susceptible to misinterpretation, but that 
is certainly what you are doing.

If there were four items in Lst, then after this statement there will be five, 
which means the list has been extended.

The item that has been added is an unnamed list. The arguments to any object 
creation function always describe the contents of that object, not the name by 
which you refer to the object.

If you wanted the next item in Lst to be a named list, you would refer to it by 
name when you assigned it:

Lst["mymatrix"] <- list (matrix=Mat)

But if you wanted to merge the elements of two lists you would concatenate:

Lst <- c(Lst, list(matrix = Mat))

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to