Re: [R] matrix and a function - apply function

2011-02-02 Thread Eik Vettorazzi
there is no need for 'apply' here, because R can handle vectors. ord<-m[,1]+m[,2]/m[,1] Am 02.02.2011 15:12, schrieb ADias: > > Hi > > I have this function and this matrix: > > function(x,y) x+y/x > > m<-matrix(c(1,2,4,2,10,8),3,2) > >> m > [,1] [,2] > [1,]12 > [2,]2 10

Re: [R] matrix and a function - apply function

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.02.2011 16:05:21: > > On Feb 2, 2011, at 9:12 AM, ADias wrote: > > > > > Hi > > > > I have this function and this matrix: > > > > function(x,y) x+y/x > > > > m<-matrix(c(1,2,4,2,10,8),3,2) > > > >> m > > [,1] [,2] > > [1,]12 > > [2,]

Re: [R] matrix and a function - apply function

2011-02-02 Thread David Winsemius
On Feb 2, 2011, at 9:12 AM, ADias wrote: Hi I have this function and this matrix: function(x,y) x+y/x m<-matrix(c(1,2,4,2,10,8),3,2) m [,1] [,2] [1,]12 [2,]2 10 [3,]48 each row represent a point (x,y) in a chart and I want via my fucntion to calculate the im

[R] matrix and a function - apply function

2011-02-02 Thread ADias
Hi I have this function and this matrix: function(x,y) x+y/x m<-matrix(c(1,2,4,2,10,8),3,2) > m [,1] [,2] [1,]12 [2,]2 10 [3,]48 each row represent a point (x,y) in a chart and I want via my fucntion to calculate the image in order to get this results: for point (1