Hello everybody, I have a list.array which is a list containing arrays, lets say list.array= list( c(1,2,3),c(5,6,7),c(1,4,6,7,8) ); I would like to apply the union function to those 3 vectors to get the union of the three : [1,2,3,4,5,6,7,8] I tried do.call(what=union,args=list.array) but this is not working... Do you have a non loop solution for this ? Regards -- View this message in context: http://r.789695.n4.nabble.com/apply-union-function-vectorially-tp2550162p2550162.html Sent from the R help mailing list archive at Nabble.com.
unique(unlist(list.array)) -- View this message in context: http://r.789695.n4.nabble.com/apply-union-function-vectorially-tp2550162p2550193.html Sent from the R help mailing list archive at Nabble.com.
Thank you very much, this solve the problem, but more generally is there a function that allow to apply a function to a list of object, applying recursively the function to each answer... mathematically for a 2 argument function f(u,v) you would like a function g doing g(u1,u2,u3,u4,u5) =f(f(f(f(u1,u2),u3),u4),u5) Thanks if you can help -- View this message in context: http://r.789695.n4.nabble.com/apply-union-function-vectorially-tp2550162p2551536.html Sent from the R help mailing list archive at Nabble.com.