[R] Assigning a vector to every element of a list.

2012-07-02 Thread Spencer Maynes
I have a vector d of unknown length, and a list b of unknown length. I would like to replace every element of b with d. Simply writing b-d does not work as R tries to fit every element of d to a different element of d, and b-rep(d,length(b)) does not work either as it makes a list of length

Re: [R] Assigning a vector to every element of a list.

2012-07-03 Thread Spencer Maynes
, Spencer Maynes wrote: I have a vector d of unknown length, and a list b of unknown length. I would like to replace every element of b with d. Simply writing b-d does not work as R tries to fit every element of d to a different element of d, and b-rep(d,length(b)) does not work either as it makes

Re: [R] Assigning a vector to every element of a list.

2012-07-03 Thread Spencer Maynes
I've taken another look, and I actually think you're right. I'm going with Gabor's. Changing d to a list is such a simple solution that I can't believe I didn't try it earlier. On Tue, Jul 3, 2012 at 1:39 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2012-07-03 09:47, Spencer Maynes wrote