[R] apply() to a function that has more than 2 arguments

Dimitris.Kapetanakis dimitrios.kapetanakis at gmail.com
Thu Jul 12 08:10:26 CEST 2012


Dear all,

I created a function which it has many arguments i.e. Mu(x, Y, B, X, P)
where Mu is the function. This function works perfect but when I am trying
to use it in the apply() function in the manner apply(Matr, 1, Mu, Y=y, B=b,
X=x, P=p) it does not work and the output is: Error in match.fun(FUN) : '1'
is not a function, character or symbol

When I transform the function Mu to have less arguments like Mu(x, DATA) and
use apply by apply(Matr, 1, Mu, DATA=data) it works perfect

Does anyone knows where is my mistake?

Thanks

Dimitris

--
View this message in context: http://r.789695.n4.nabble.com/apply-to-a-function-that-has-more-than-2-arguments-tp4636257.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list