Skip to content

Assignment of structures on a given environment]

1 message · Rita Ribeiro

#
Robert Gentleman wrote:

            
functions or
a
Hi, again


    My problem is  concerned with the fact that my list will be a list
of lists
which  elements will be sucessively appended and defined.
    I want to "build" the whole list into the environment. preserving
its structure
(it will be useful for me to be able to manipulate the list later).
    More precisely, I want to do ,in a given environment, something
like:

            l  <- alist()

            l$first <- alist()
            l$first[ind] <- as.list(c(20,40))  # where ind is local
vector
containind the elements names

            l$second <- 50

            So If i do

            > l
            $first
            $first$a
            [1] 20

            $first$b
            [1] 40


            $second
            [1] 50





            and

            > l$first$b
            [1] 40


            I'm searching for some alternative to solution to  define
this hierarchy
in the designed environment, without needing to use the 'evalq'
command..... Is
there one?

            Thanks again,

            Rita
of
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
+---------------------------------------------------------------------------+
632-5250                   |
632-2444                   |
rgentlem at jimmy.dfci.harvard.edu   |
+---------------------------------------------------------------------------+
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



-------------- next part --------------
An embedded message was scrubbed...
From: Rita Ribeiro <rita at liacc.up.pt>
Subject: Re: [R] Assignment of structures on a given environment
Date: Wed, 17 Oct 2001 11:26:42 +0100
Size: 5022
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20011017/e982c9f4/attachment.mht