AW: [R] using matrix data for function

"Unternährer Thomas, uth" uth at zhwin.ch
Wed Sep 17 20:16:24 CEST 2003


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

	-----Ursprüngliche Nachricht----- 
	Von: Bing Zhang [mailto:bih at ornl.gov] 
	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: zhangb at ornl.gov
	
	______________________________________________
	R-help at stat.math.ethz.ch mailing list
	https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list