Constructing a Decision Tree using arguments in caret package in R I am trying to construct a decision tree using the caret package in R. Can someone please explain to me what is the difference between the "metric" and "parms" arguments as shown in the R code below? I'm trying to understand how this tree is being constructed.
train(Credit ~ CreditAmount + Age + CreditHistory + Employment,
            data = credit,
            method = 'rpart',
            trControl = trainControl(method = 'cv', number = 6),
            metric = "Accuracy",
            tuneGrid = expand.grid(cp = seq(0, 0.1, 0.001)),
            na.action = na.omit,
            parms = list(split='information'))

 A: The parms is fed into the rpart model, and it is a metric, used by rpart to choose a variable at each step that best splits the set of items:
parms: a list of method specific optional parameters. For classification, the list can
contain any of: the vector of prior probabilities (component prior), the loss matrix
(component loss) or the splitting index (component split). The priors must be
positive and sum to 1. The loss matrix must have zeros on the diagonal and positive
off-diagonal elements. The splitting index can be "gini" or "information".

You can read this for more details and I would say this parms option decides how you want to construct the tree model, just like the complexity parameter cp you are training on with caret. 
What you need to do after fitting the model is to evaluate how good it is at predicting labels on the tested fold and select the best cp based on this. In your example, you set it to be "Accuracy", but you can also set it to be "Kappa" (cohen's kappa) or other defined metrics. For example:
library(caret)
mdl = train(Species ~ .,data=iris,method="rpart")
print(mdl)

CART 

150 samples
  4 predictor
  3 classes: 'setosa', 'versicolor', 'virginica' 

No pre-processing
Resampling: Bootstrapped (25 reps) 
Summary of sample sizes: 150, 150, 150, 150, 150, 150, ... 
Resampling results across tuning parameters:

  cp    Accuracy   Kappa    
  0.00  0.9334562  0.8993173
  0.44  0.8144866  0.7246185
  0.50  0.5181330  0.3012537

Accuracy was used to select the optimal model using the largest value.
The final value used for the model was cp = 0.

From the above training, cp = 0 was chosen because it has the highest accuracy. Unfortunately you cannot use caret to find whether gini or information is better. Hope this clears the confusion
