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
)

26 s
26

With rbind

do.call(rbind.data.frame, your_list)

Edit: Previous version return data.frame of list‘s instead of vectors (as @IanSudbery pointed out in comments).

Leave a Reply

Your email address will not be published. Required fields are marked *