Learn R Programming

SciencesPo (version 1.02.12)

unnest: Unnest a Nested List

Description

Unnest nested lists made easy.

Usage

unnest(x)

Arguments

x
A nested list

Value

  • A list, with no nesting, hopefully

encoding

UTF-8

Examples

Run this code
# Unnest the list
# a nested list
mylist <- list(); inerlist <- list()
for(i in 1:5) {
  for(j in 1:5) {
   mylist[[j]] <- i*j
 }
 inerlist[[i]] <- mylist
}
unnest(inerlist)[[1]]
unnest(inerlist)

Run the code above in your browser using DataLab