I am not sure what you are trying to do, since you say you have a list of data.frames but the example you provide is only a list of lists with elements of length one.
Lets assume you have a list of data.frames, which in turn contain vectors of length > 1, and you want to drop all columns that "only" contain NAs.
df.ls <- list(data.frame(id = c(NA,NA,NA),
x = c(NA,3,5),
works = c(4,5,NA)),
data.frame(id = c("a","b","c"),
x = c(NA,3,5),
works = c(NA,NA,NA)),
data.frame(id = c("e","d",NA),
x = c(NA,3,5),
works = c(4,5,NA)))
> [[1]]
id x works
1 NA NA 4
2 NA 3 5
3 NA 5 NA
[[2]]
id x works
1 a NA NA
2 b 3 NA
3 c 5 NA
[[3]]
id x works
1 e NA 4
2 d 3 5
3 <NA> 5 NA
Then this approach will work:
library(dplyr)
library(purrr)
non_empty_col <- function(x) {
sum(is.na(x)) != length(x)
}
map(df.ls, ~ .x %>% select_if(non_empty_col))
Which returns your list of data.frames without columns that contain only NA.
[[1]]
x works
1 NA 4
2 3 5
3 5 NA
[[2]]
id x
1 a NA
2 b 3
3 c 5
[[3]]
id x works
1 e NA 4
2 d 3 5
3 <NA> 5 NA
If you, however, prefer your list to have only complete cases in each data.frame (rows with no NAs), then the following code will work.
library(dplyr)
map(df.ls, ~ .x[complete.cases(.x), ])
Leaving you, in case of my example data, only with row 2 of data.frame 3.