Re: [R] is there a way to recursilvely lapply

2008-12-11 Thread Gabor Grothendieck
This will recursively lapply and may or may not be what you are looking for: rapply(x, sum) On Thu, Dec 11, 2008 at 2:59 PM, Whit Armstrong armstrong.w...@gmail.com wrote: for a simple example: x - list() x[[a]] - list(a=c(1,2,3),b=c(3,4,5)) x[[b]] - list(a=c(6,7,8),b=c(9,10,11))

Re: [R] is there a way to recursilvely lapply

2008-12-11 Thread Prof Brian Ripley
On Thu, 11 Dec 2008, Whit Armstrong wrote: for a simple example: x - list() x[[a]] - list(a=c(1,2,3),b=c(3,4,5)) x[[b]] - list(a=c(6,7,8),b=c(9,10,11)) lapply(x,sum) this fails w/ Error in FUN(X[[1L]], ...) : invalid 'type' (list) of argument Just wondering if I have overlooked something

Re: [R] is there a way to recursilvely lapply

2008-12-11 Thread Whit Armstrong
Thanks, Gabor and Prof. Ripley. Sorry for the oversight. I grepped the lapply help for recursive prior to sending my question. why does it appear as *r*ecursive in the help file? or is that just a formating problem on my machine? -Whit On Thu, Dec 11, 2008 at 3:13 PM, Prof Brian Ripley

Re: [R] is there a way to recursilvely lapply

2008-12-11 Thread Prof Brian Ripley
On Thu, 11 Dec 2008, Whit Armstrong wrote: Thanks, Gabor and Prof. Ripley. Sorry for the oversight. I grepped the lapply help for recursive prior to sending my question. why does it appear as *r*ecursive in the help file? or is that just a formating problem on my machine? It is marked as

Re: [R] is there a way to recursilvely lapply

2008-12-11 Thread Whit Armstrong
yes, that is correct. I was looking in text mode. ok, thanks for your help. -Whit On Thu, Dec 11, 2008 at 4:02 PM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On Thu, 11 Dec 2008, Whit Armstrong wrote: Thanks, Gabor and Prof. Ripley. Sorry for the oversight. I grepped the lapply help