I have a list which has dataframes of various dimensions. I want to extract those dataframes who rows greater than 30 I tried :
DR<-sapply(list, function(x)
Assuming your list is called list_df, we can use Filter
list_df
Filter
Filter(function(x) nrow(x) == 30, list_df)
Or sapply
sapply
list_df[sapply(list_df, nrow) == 30]
We can also use purrr::keep
purrr::keep
purrr::keep(list_df, ~nrow(.) == 30)