I'm not sure if that's the best way
 
apply(MAT, 1, FUN)
 
 

        -----Ursprüngliche Nachricht----- 
        Von: Bing Zhang [mailto:[EMAIL PROTECTED] 
        Gesendet: Mi 17.09.2003 20:02 
        An: r-help 
        Cc: 
        Betreff: [R] using matrix data for function
        
        

        Hi All,
        
        I have a function, f(x,y)
        I have a matrix of data, m,  with the 1st column is x and the 2nd column is y
        What's the best way to get f(x,y) for each row of the matrix?
        I tried
        result<-f(m[,1],m[,2]) but it doesn't work.
        
        Thanks!
        
        Bing
        
        ---------------------------------
        1060 Commerce Park
        Oak Ridge National Laboratory
        P.O. Box 2008, MS 6480
        Oak Ridge, TN 37831-6480
        Phone: 865-241-0761
        Email: [EMAIL PROTECTED]
        
        ______________________________________________
        [EMAIL PROTECTED] mailing list
        https://www.stat.math.ethz.ch/mailman/listinfo/r-help

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to