Re: [R] Error with lapply [addirional clarification needed]

2008-11-22 Thread megh
I need one more clarification here : Here I did : fn - function(i) return(list(i, i^2)) ss = sapply(1:4, fn) Here the object ss should be a matrix object : is.matrix(ss) However I feel it lacks some the matrix object properties. For example the syntax min(ss[1,]) generates an error : Error in

Re: [R] Error with lapply [addirional clarification needed]

2008-11-22 Thread Peter Dalgaard
megh wrote: I need one more clarification here : Here I did : fn - function(i) return(list(i, i^2)) ss = sapply(1:4, fn) Here the object ss should be a matrix object : is.matrix(ss) However I feel it lacks some the matrix object properties. For example the syntax min(ss[1,]) generates an

Re: [R] Error with lapply [addirional clarification needed]

2008-11-22 Thread Gabor Grothendieck
Try str(ss) to see what it really looks like. You probably want: fn - function(i) c(i, i^2) On Sat, Nov 22, 2008 at 4:54 AM, megh [EMAIL PROTECTED] wrote: I need one more clarification here : Here I did : fn - function(i) return(list(i, i^2)) ss = sapply(1:4, fn) Here the object ss