I have a variable that evaluates to T/F if a variable named "aic" exists.
aic_exist <- c("aic" %in% names(fexp_list[[i]]), "aic" %in% names(fg_list[[i]]), "aic" %in% names(fln_list[[i]]), "aic" %in% names(fnorm_list[[i]]), "aic" %in% names(funif_list[[i]]), "aic" %in% names(fw_list[[i]])).
aic_exist evaluates to [1] FALSE  TRUE  TRUE  TRUE  TRUE  TRUE.
I would like to create another variable aic_values that contains only values using the aic_exist variable. i.e. not include fexp_list as there is no aic value.
Something like aic_values <- (c(fexp_list[[i]][["aic"]], fg_list[[i]][["aic"]], fln_list[[i]][["aic"]], fnorm_list[[i]][["aic"]], funif_list[[i]][["aic"]], fw_list[[i]][["aic"]])) but comparing to aic_exist?
 
    