Try this:

> a <- list(a = 1, b = 2, c = 3)
> assign("a", replace(get("a"), 3, 2.34))
> a
$a
[1] 1

$b
[1] 2

$c
[1] 2.34

On 1/13/07, Tong Wang <[EMAIL PROTECTED]> wrote:
> Hi,
>    I would like to assign a value to a member b  of the list  a  in position 
> 3,   by calling:
>
>                                            assign( target, 2.34, 3)
>
> My question is what the "target" should be.   I tried target <- paste("a", $, 
> "b")   and something else,
> but haven't got the right answer yet.
>
> BTW, if I attached a list named  "mylist" in position 3,  to refer to this 
> environment, besides 3, what's the
> right name ?
>
> Thanks a lot for any help
>
> tong
>
> ______________________________________________
> [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.
>

______________________________________________
[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