Convert your matrix to a data frame and use do.call(). ?do.call do.call(Myfunc, data.frame(yourMatrix))
You need to do the data frame conversion because do.call wants the arguments as a list and a data frame **is** a list (the columns are the list members) with a dim attribute (+ others). Bert Gunter Genentech Nonclinical Biostatistics -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ManInMoon Sent: Thursday, March 18, 2010 5:39 AM To: r-help@r-project.org Subject: [R] "unbind" matrix? I have a function that take a variable number of arguments, each of which must be a vector. Is there a way to "unbind" a matrix that would pass the columns as vectors? Myfunc<-function(...) { [My code] } Myfunc(z[,1],z[,2]) works but Myfunc(z[,1:2]) is passing a submatrix Is there something like Myfunc(unbind(z[,1:2])) ?? -- View this message in context: http://n4.nabble.com/unbind-matrix-tp1597887p1597887.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.