Simone Vantini
2004-Sep-01 22:58 UTC
[R] How to personalize the rpart function: t.default(x)
I'm trying to personalize the rpart function by introducing a list('init','split','eval') in the argument method. But I receive an error message:"Error in t.default(x): argument is not a matrix". Can anyone tell me what the argument of this function is or where this function appears in the rpart function.Thanks Simone Vantini
t is for transpose; look at ?t, ?t.default, ?t.data.frame Bottom line: Somewhere in your code you are trying to transpose something that is not a matrix. (Or you are passing to an existing function an object which that function expects to be a matrix, but isn't.) cheers, Rolf Turner rolf at math.unb.ca
On top of what Rolf had said, traceback() would help tracking down how the error happened. Andy> From: Rolf Turner > > t is for transpose; look at ?t, ?t.default, > ?t.data.frame > > Bottom line: Somewhere in your code you are trying to transpose > something that is not a matrix. (Or you are passing to an existing > function an object which that function expects to be a matrix, but > isn't.) > > cheers, > > Rolf Turner > rolf at math.unb.ca > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
Prof Brian Ripley
2004-Sep-02 06:24 UTC
[R] How to personalize the rpart function: t.default(x)
On Thu, 2 Sep 2004, Simone Vantini wrote:> I'm trying to personalize the rpart function by introducing a > list('init','split','eval') in the argument method. But I receive an error > message:"Error in t.default(x): argument is not a matrix". > Can anyone tell me what the argument of this function is or where this > function appears in the rpart function.Thanks Simone Vantinit.default is the default method for the transpose function t() in R itself. Try help! Description: Given a matrix or 'data.frame' 'x', 't' returns the transpose of 'x'. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595