Re: [R] apply in apply

2008-05-30 Thread baptiste Auguié
Very nice, i really like this one! May confuse non-R users, but that's not a concern here. Thanks a lot, baptiste On 30 May 2008, at 13:19, Charilaos Skiadas wrote: I think this is where the beauty of ... comes in, the following should be doing just what you want: sapply(my.data, apply

Re: [R] apply in apply

2008-05-30 Thread Charilaos Skiadas
On May 30, 2008, at 5:37 AM, baptiste Auguié wrote: Thank you for the suggestions (off-list as well). I think the best option may eventually be an explicit for loop to make things clearer. To clarify a bit, I've used the plot function in the example where in fact it is a numerical integrat

Re: [R] apply in apply

2008-05-30 Thread baptiste Auguié
Thank you for the suggestions (off-list as well). I think the best option may eventually be an explicit for loop to make things clearer. To clarify a bit, I've used the plot function in the example where in fact it is a numerical integration (which is why I need to pass an additional variab

Re: [R] apply in apply

2008-05-30 Thread Richard . Cotton
> I need to apply a function on each column of each matrix contained in > a list. Consider the following code, > > > x <- 1:3 > > my.data <- list(matrix(c(1,2,3,4,5,6),ncol=2), > > matrix(c(4,5,6,7,8,9),ncol=2)) > > > > par(mfrow=c(2,2)) > > results <- sapply(1:length(my.data), > >

[R] apply in apply

2008-05-30 Thread baptiste Auguié
Dear list, I need to apply a function on each column of each matrix contained in a list. Consider the following code, x <- 1:3 my.data <- list(matrix(c(1,2,3,4,5,6),ncol=2), matrix(c(4,5,6,7,8,9),ncol=2)) par(mfrow=c(2,2)) results <- sapply(1:length(my.data), function(ii)