作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图在几个列表上做联合(这些实际上是 GRanges 对象而不是整数列表,但原理是一样的),基本上是一个大联合。
x<-sort(sample(1:20, 9))
y<-sort(sample(10:30, 9))
z<-sort(sample(20:40, 9))
mylists<-c("x","y","z")
emptyList<-list()
sapply(mylists,FUN=function(x){emptyList<-union(emptyList,get(x))})
union(x,union(y,z))
[1] 2 3 5 6 7 10 13 15 20 14 19 21 24 27 28 29 26 31 36 39
最佳答案
与 GRanges 一起工作的不一定是内存高效的范例是
Reduce(union, list(x, y, z))
GRangesList(x, y, z)
对于
x
的适当值等等。
关于r - 多个工会,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5516070/
我是一名优秀的程序员,十分优秀!