Re: [R] list() assigning the same value to two items

2010-06-22 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
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(modifyList(L,

Re: [R] list() assigning the same value to two items

2010-06-22 Thread Deepayan Sarkar
On Mon, Jun 21, 2010 at 4:28 PM, Thaler, Thorn, LAUSANNE, Applied Mathematics thorn.tha...@rdls.nestle.com 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

Re: [R] list() assigning the same value to two items

2010-06-22 Thread Greg Snow
greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Thaler, Thorn, LAUSANNE, Applied Mathematics Sent: Monday, June 21, 2010 3:30 AM To: r-help@r-project.org Subject: [R] list() assigning the same

[R] list() assigning the same value to two items

2010-06-21 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
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=tmp,

Re: [R] list() assigning the same value to two items

2010-06-21 Thread Peter Ehlers
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.

Re: [R] list() assigning the same value to two items

2010-06-21 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
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 list with two elements, where both elements have

Re: [R] list() assigning the same value to two items

2010-06-21 Thread Gabor Grothendieck
On Mon, Jun 21, 2010 at 6:58 AM, Thaler, Thorn, LAUSANNE, Applied Mathematics thorn.tha...@rdls.nestle.com 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