R中的加入列表 [英] Joining Lists in R

查看:61
本文介绍了R中的加入列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在R中加入两个列表,但是我真的不知道该怎么做.我需要一种方法,通过仅将名称与第一个列表不同的元素添加到列表中,例如:

I am trying to join two lists in R, but I really don't know how to do it. I need a way to join the to lists by adding only the elements that have a different name from the ones to the first list, say:

list1=list('a'=1,'b'=2,'c'=3,'d'=4,'e'=5);
list2=list('b'=10,'c'=100,'e'=98);
list3=OpErAtIoN(list1,list2)

然后得到list3是list('a'=1,'b'=10,'c'=100,'d'=4,'e'=98)

And one gets that list3 is list('a'=1,'b'=10,'c'=100,'d'=4,'e'=98)

您知道吗?谢谢!

推荐答案

这与您的示例具有相同的结果:

This gives the same result as your example:

modifyList(list1, list2)

这篇关于R中的加入列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆