Learn R Programming

SciencesPo (version 0.11.21)

unnest: Unnest lists.

Description

Unnest a nested list.

Usage

unnest(x)

Arguments

x
A nested list.

Value

  • A list, with no nesting, hopefully.

encoding

UTF-8

Examples

Run this code
# 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 the list
unnest(inerlist)[[1]]

Run the code above in your browser using DataLab