I am trying to grow a list in R, where both the value and the name of each record are stored in a variable, but it does not work.
my_models_names <- names(my_models) my_rocs=list() for (modl in my_models_names) { my_probs <- testPred[[modl]]$Y1 my_roc <- roc(Ytst, my_probs) c(my_rocs, modl=my_roc)
My list my_rocs empty at the end, although I know the iteration loop ( my_roc full). Why?
In the corresponding note, is there a way to do this without a loop?
source share