> The e1071 function naiveBayes gives an error when called by do.call, although it doesn't give any error if I call it manually.
> Browse> trainParams@classifier
> function (x, ...)
> <environment: namespace:e1071>
> Browse> trained <- do.call(trainParams@classifier, paramList)
> Error in names(dimnames(tables[[i]])) <- c(Yname, colnames(x)[i]) :
> 'names' attribute  must be the same length as the vector 
> Browse> summary(paramList)
> Length Class Mode
> 925 -none- numeric
> 37 factor numeric
> verbose 1 -none- logical
> Browse> class(trainParams@classifier(paramList[], paramList[], paramList[]))
>  "naiveBayes"
> What is the explanation for this ? I read that the behaviour of do.call is currently undefined and subject to change.
Read where? Not in the documentation, as far as I can see.
Problems with do.call are usually related to lack of lazy evaluation since "args" in do.call is a list of _evaluated_ arguments.
You're not giving sufficient context, but I would conjecture that "Yname" is computed via deparse(substitute(Y)) or something like that. If so, you will run into effects like this (notice the y axis title):