flatten_list: Internal function to flatten a nested list

View source: R/dictionaries.R

flatten_listR Documentation

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

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

quanteda documentation built on Sept. 11, 2024, 6:08 p.m.