How to subset data.frames stored in a list?

后端 未结 2 1115
南方客
南方客 2020-12-30 12:38

I created a list and I stored one data frame in each component. Now I would like to filter those data frames keeping only the rows that have NA in a specific column. I would

2条回答
  •  青春惊慌失措
    2020-12-30 13:27

    Regarding the question in @Riccardo's last comment, try:

    lapply(my.ls, "[", 1)
    

    or alternately:

    lapply(my.ls, "[[", 1)
    

    depending on whether you want the output to be a list of dataframes or a list of vectors.

提交回复
热议问题