Skip to content
Prev 201991 / 398503 Next

Removing objects from a list based on nrow

Try these:
sapply(lst, nrow) # get row numbers
which(sapply(lst, nrow) < 3) # get the index of rows which has less than 3 rows
lst <- lst[-which(sapply(lst, nrow) < 3)] # remove the rows from the list
On Sun, Nov 29, 2009 at 4:36 PM, Tim Clark <mudiver1200 at yahoo.com> wrote: