[R] Extracting data from list of lists of dataframes

H @gent@ @end|ng |rom medd@t@|nc@com
Thu May 28 03:37:45 CEST 2020


I am a newcomer to R and have been struggling with the following problem:

I have a list1(1:N) containing a list2(1:2) each containing dataframes with the same column names but different number of rows. Both lists are named and the rows and the columns in the dataframe are named. I then would like to use select() and filter() on the dataframes to select data.

I would like to: (1) select among the top-level lists, (2) select among the second-level lists and (3) finally use select() and filter() on the dataframe data.

My attempt so far is:

list1[grepl("myfirstselection", names(list1)][grepl("mysecondselection", names(list1[[]]))]

Needless to say it does not work... And, I have not even gotten to the dataframes yet... ;-)



More information about the R-help mailing list