We are trying to predict YPLL (Years of Potential Life Lost ) for a set of data.
Predicting the YLLP: which is a measure of premature mortality of a person.

The relationship between dependent and independent variables are not linear so I went for Random forest to build my model.

I am using R. However in random forest when I try to execute the below statement in R I am getting error.

m_rf<- train(YPLLRate ~. , data= Train2 , method="C5.0",metric= "Kappa" , trControl = control, tuneGrid = grid_ref)


Error in train.default(x, y, weights = w, ...) :
wrong model type for regression

Can you please help me understand where I am getting wrong?