bject: [R] list() assigning the same value to two items
>
> Hi everybody,
>
> I'd like to have a list with two elements, where both elements have the
> same value:
>
> z <- list(a=1, b=1)
>
> If it happens, that I've to change the value, I've to
On Mon, Jun 21, 2010 at 4:28 PM, Thaler, Thorn, LAUSANNE, Applied
Mathematics wrote:
> Thanks, works as expected. But maybe I've to be a bit more clear about the
> reason why I'd like to have such a construct.
>
> In lattice you can define some parameters by passing a named list to
> par.setting
> Try this variation of my.transform that I had posted here:
> http://tolstoy.newcastle.edu.au/R/e2/help/07/09/24707.html
>
> List <- function(..., L = list()) {
>f <- function(){}
>formals(f) <- eval(substitute(as.pairlist(c(alist(...), L
>body(f) <- substitute(modifyL
On Mon, Jun 21, 2010 at 6:58 AM, Thaler, Thorn, LAUSANNE, Applied
Mathematics wrote:
> Thanks, works as expected. But maybe I've to be a bit more clear about the
> reason why I'd like to have such a construct.
>
> In lattice you can define some parameters by passing a named list to
> par.setting
lgary.ca]
Sent: lundi 21 juin 2010 11:47
To: Thaler,Thorn,LAUSANNE,Applied Mathematics
Cc: r-help@r-project.org
Subject: Re: [R] list() assigning the same value to two items
On 2010-06-21 3:30, Thaler, Thorn, LAUSANNE, Applied Mathematics wrote:
> Hi everybody,
>
> I'd like to have a
On 2010-06-21 3:30, Thaler, Thorn, LAUSANNE, Applied Mathematics wrote:
Hi everybody,
I'd like to have a list with two elements, where both elements have the same
value:
z<- list(a=1, b=1)
If it happens, that I've to change the value, I've to assure that I change
both. This is error prone. H
Hi everybody,
I'd like to have a list with two elements, where both elements have the same
value:
z <- list(a=1, b=1)
If it happens, that I've to change the value, I've to assure that I change
both. This is error prone. Hence, a better way to achieve this is to define:
tmp <- 1
z <- list(a=tm
7 matches
Mail list logo