title: Adding metrics to default train() output from the caret package
body: <p>I would like to add additional metrics other than RMSE and Rsquared to the output of my linear model that I creating with the caret package. From what I understand, the code below will output the repeated cross-validated RMSE and Rsquared:</p>
  
  <pre><code>library(caret)
  lm_reg1 &lt;- train(log1p(mpg) ~ log1p(hp) + log1p(disp),
                   data = mtcars,
                   trControl = trainControl(method = "repeatedcv",
                                            number = 10,
                                            repeats = 10),
                   method = 'lm')
  lm_reg
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Linear Regression 
  
  32 samples
  10 predictors
  
  No pre-processing
  Resampling: Cross-Validated (10 fold, repeated 10 times) 
  Summary of sample sizes: 30, 29, 28, 29, 29, 28, ... 
  Resampling results:
  
    RMSE       Rsquared 
    0.1134972  0.8808378
  </code></pre>
  
  <p>I know I can modify the output to a custom metric by modifying the summaryFunction in trainControl and referring to it's name in the metric parameter. Here's an example of one that I created that calculates the MAPE of a log-log model:</p>
  
  <pre><code>mape &lt;- function(actual, predicted){
    mean(abs((actual - predicted)/actual))
  }
  mapeexpSummary &lt;- function (data,
                              lev = NULL,
                              model = NULL) {
    out &lt;- mape(expm1(data$obs), expm1(data$pred))  
    names(out) &lt;- "MAPEEXP"
    out
  }
  lm_reg2 &lt;- train(log1p(mpg) ~ log1p(hp) + log1p(disp),
                  data = mtcars,
                  trControl = trainControl(method = "repeatedcv",
                                           number = 10,
                                           summaryFunction = mapeexpSummary,
                                           repeats = 10),
                  metric = 'MAPEEXP',
                  method = 'lm')
  lm_reg2
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Linear Regression 
  
  32 samples
  10 predictors
  
  No pre-processing
  Resampling: Cross-Validated (10 fold, repeated 10 times) 
  Summary of sample sizes: 28, 29, 29, 28, 28, 30, ... 
  Resampling results:
  
    MAPEEXP  
    0.1022028
  </code></pre>
  
  <p>Is there any way to add them to a single output? I'm looking to save all of these values, but want to avoid creating two identical models to do so.</p>