0

I want to use "varImp" from the caret package. It worked before and I am unsure why it won`t work anymore. I applied it on a log-model.

log_model_logit <- glm(f_status_loan ~ ., family = binomial(link = logit), data = training_set)

However, I get an error

'could not find function "varImp"' when I apply

varImp(log_model_probit)

I also get an error when I apply

caret::varImp(log_model_probit)

I am not sure what to do about the error except deleting all my packages and installing afresh. I would appreciate if someone could help me and knows how to solve this issue.

Your help is much appreciated.

NelsonGon
  • 13,015
  • 7
  • 27
  • 57

1 Answers1

0

It works when you add scale = FALSE or scale = TRUE in brackets as follows

var_imp_log <- caret::varImp(log_model_probit) %>% as.data.frame() 

I am still unsure why it stopped working without it but I am happy that it is working now. I hope somebody else could help this as well. Would have saved me about 1.5 hours

NelsonGon
  • 13,015
  • 7
  • 27
  • 57
  • Without a sample of your data, we(the community) cannot know what exactly was the problem. Please edit your question as shown [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – NelsonGon Mar 19 '19 at 10:33