How to delete empty data.frame in a list after subsetting in R [duplicate]
问题 This question already has answers here : Filtering list of dataframes based on the number of observations in each dataframe (4 answers) Closed 1 year ago . Suppose I'm subsetting from a list of named data.frame s with respect to a subsetting variable called long . After subsetting, some data.frame s in the list may be empty because there is no match for subsetting in them. I was wondering how I could delete all such empty data.frame s in my final output. A simple example, and my unsuccessful