thanks a lot for the help!
On Tue, Jul 19, 2016 at 7:20 PM, Gabor Grothendieck
wrote:
> Try this:
>
> Reduce(modifyList, list(x, y, z))
>
> On Tue, Jul 19, 2016 at 12:34 PM, Luca Cerone wrote:
>> Dear all,
>> I would like to know if there is a function to concatenate two lists
>> while repla
Try this:
Reduce(modifyList, list(x, y, z))
On Tue, Jul 19, 2016 at 12:34 PM, Luca Cerone wrote:
> Dear all,
> I would like to know if there is a function to concatenate two lists
> while replacing elements with the same name.
>
> For example:
>
> x <- list(a=1,b=2,c=3)
> y <- list( b=4, d=5
concatfun <- function(...) {
Reduce(f=function(a,b){ a[names(b)] <- b ; a },x=list(...), init=list())
}
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Jul 19, 2016 at 9:34 AM, Luca Cerone wrote:
> Dear all,
> I would like to know if there is a function to concatenate two lists
> while
Dear all,
I would like to know if there is a function to concatenate two lists
while replacing elements with the same name.
For example:
x <- list(a=1,b=2,c=3)
y <- list( b=4, d=5)
z <- list(a = 6, b = 8, e= 7)
I am looking for a function "concatfun" so that
u <- concatfun(x,y,z)
returns:
u$a
4 matches
Mail list logo