Re: [R] update numeric values of list with new values...

2017-09-22 Thread Evan Cooch
Thanks! On 9/22/2017 12:34 PM, Bert Gunter wrote: > Well,  that's a bit like driving from Boston to New York by way of > Chicago. > > See ?structure > > test <- list(a=1,b=2,c=3) > new <- c(4,5,6) > test.new <- structure(as.list(new), names=names(test)) > test.new > $a > [1] 4 > > $b > [1] 5 > >

Re: [R] update numeric values of list with new values...

2017-09-22 Thread Bert Gunter
Well, that's a bit like driving from Boston to New York by way of Chicago. See ?structure test <- list(a=1,b=2,c=3) new <- c(4,5,6) test.new <- structure(as.list(new), names=names(test)) test.new $a [1] 4 $b [1] 5 $c [1] 6 Cheers, Bert Bert Gunter "The trouble with having an open mind is

Re: [R] update numeric values of list with new values...

2017-09-22 Thread Evan Cooch
Solved it: test <- list(a=1,b=2,c=3) new <- c(4,5,6) hold <- as.list(new) updated_test <- replace(test,c(1:3),hold) $a [1] 4 $b [1] 5 $c [1] 6 mean.parms <- as.list(mean.parms) mm.parms <- replace(far.parms,c(1:length(far.parms)),mean.parms) On 9/22/2017 10:34 AM, Evan Cooch wrote: Supp

[R] update numeric values of list with new values...

2017-09-22 Thread Evan Cooch
Suppose I have the following: test <- list(a=1,b=2,c=3) I also have a vector (or list, or something else...) with new numbers new <- c(4,5,6) What I'm trying to figure out is how to take the list, and update the numbers from {1,2,3} to {4,5,6} So, in the end,I want the 'update' test list to