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
>
>
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
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
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
4 matches
Mail list logo