Here is the last code that I wrote but it would give me the same problem:
I have the matrix mat with n columns mat.1, mat.2 ...mat.n
#To be able to use lapply I convert it to a data.frame:
mat <- data.frame(mat)
lapply(mat, function, argument of function)
It works but I still get for all elements the function applied for the last
element. The elements of my results are all the same I don't understand I
did exactly as shown on this website:
http://www.ats.ucla.edu/stat/r/library/advanced_function_r.htm#lapply
--
View this message in context:
http://n4.nabble.com/How-to-apply-a-function-on-each-column-of-a-matrix-tp1288436p1288471.html
Sent from the R help mailing list archive at Nabble.com.