Learn R Programming

quanteda (version 4.1.0)

flatten_list: Internal function to flatten a nested list

Description

Internal function to flatten a nested list

Usage

flatten_list(
  lis,
  levels = 1:100,
  level = 1,
  key_parent = "",
  lis_flat = list()
)

Arguments

lis

a nested list

levels

an integer vector indicating levels in the list

level

an internal argument to pass current levels

key_parent

an internal argument to pass for parent keys

lis_flat

an internal argument to pass the flattened list

Examples

Run this code
lis <- list("A" = list("B" = c("b", "B"), c("a", "A", "aa")))
quanteda:::flatten_list(lis, 1:2)
quanteda:::flatten_list(lis, 1)

Run the code above in your browser using DataLab