Convert a list to a data frame
Asked 07 September, 2021
Viewed 2.5K times
  • 67
Votes

I have a nested list of data. Its length is 132 and each item is a list of length 20. Is there a quick way to convert this structure into a data frame that has 132 rows and 20 columns of data?

Here is some sample data to work with:

l <- replicate(
  132,
  as.list(sample(letters, 20)),
  simplify = FALSE
)

24 Answer