[R] variable names

Luis Miguel Almeida da Silva lsilva at fc.up.pt
Tue Jul 22 15:48:33 CEST 2003

Dear helpers
I want to use rpart several times in a loop to build a classification tree. My problem is that rpart needs a formula as argument and for that the variables need to have names and this doesn't happen in my case. Every iteration in the loop has a different dataset with several variables (ex. 38 or more) and so I can't type the names by hand every time. Is there any function that generates names for variables in a dataframe. If so, how can I use then the argument
rpart(classlabels~. ,.....)

More information about the R-help mailing list