I try to make unions on several lists (in fact, they are objects of GRanges, not whole lists, but they are the same), basically one big union.
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))})
It just returns the contents of the list. I need an equivalent
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
but written in an extensible and not "variable explicit form" form
Jeremy leipzig
source share