Suppose we have the following list structure:
bla <- list(lda = list(list(auc1 = 0.85, auc2 = 0.56), list(auc1 = 0.65, auc2 = 0.72)),
j48 = list(list(auc1 = 0.99, auc2 = 0.81), list(auc1 = 0.61, auc2 = 0.85)),
c50 = list(list(auc1 = 0.92, auc2 = 0.59), list(auc1 = 0.68, auc2 = 0.80)))
The desired output is a data frame structured as:
auc1 auc2
lda 0.85 0.56
lda 0.65 0.72
j48 0.99 0.81
j48 0.61 0.85
c50 0.92 0.59
c50 0.68 0.80
My attempt is pasted below. I'm able to purrr each inner list separately using the call:
bla[[1]] %>%
map(., function(x) c(auc1 = x[["auc1"]],
auc2 = x[["auc2"]])) %>%
map_dfr(., as.list)
Any idea is appreciated.