nest_dictionary: Utility function to generate a nested list

Description Usage Arguments Examples

View source: R/dictionaries.R

Description

Utility function to generate a nested list

Usage

1

Arguments

dict

a flat dictionary

depth

depths of nested element

Examples

1
2
3
4
lis <- list("A" = c("a", "aa", "aaa"), "B" = c("b", "bb"), "C" = c("c", "cc"), "D" = c("ddd"))
dict <- quanteda.core:::list2dictionary(lis)
quanteda.core:::nest_dictionary(dict, c(1, 1, 2, 2))
quanteda.core:::nest_dictionary(dict, c(1, 2, 1, 2))

koheiw/quanteda.core documentation built on Sept. 21, 2020, 3:44 p.m.