Transforming a nested data frame with varying number of elements
问题 I have a data frame with a column of nested data frames with 1 or 2 columns and n rows. It looks like df in the sample below: 'data.frame': 3 obs. of 2 variables: $ vector:List of 3 ..$ : chr "p1" ..$ : chr "p2" ..$ : chr "p3" $ lists :List of 3 ..$ :'data.frame': 2 obs. of 2 variables: .. ..$ n1: Factor w/ 2 levels "a","b": 1 2 .. ..$ n2: Factor w/ 2 levels "1","2": 1 2 ..$ :'data.frame': 1 obs. of 1 variable: .. ..$ n1: Factor w/ 1 level "d": 1 ..$ :'data.frame': 1 obs. of 2 variables: .. .