Re: [R] apply union function vectorially
Yes Thank you very much, NICE ONE. Do you have some interesting references about R (I do know some common books but may be you have some nice hidden books I have never heard about... ) -- View this message in context: http://r.789695.n4.nabble.com/apply-union-function-vectorially-tp2550162p2704852.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] apply union function vectorially
Hi: Look at the examples in ?Reduce HTH, Dennis On Thu, Sep 23, 2010 at 12:31 AM, statquant2 wrote: > > 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. > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] apply union function vectorially
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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] apply union function vectorially
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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] apply union function vectorially
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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.