Unlist: Unlist a list, starting only from a set depth.

View source: R/NCmisc.R

UnlistR Documentation

Unlist a list, starting only from a set depth.

Description

Allows unlisting preserving the top levels of a list. Can specify the number of list depth levels to skip before running unlist()

Usage

Unlist(obj, depth = 1)

Arguments

obj

the list to unlist

depth

skip to what layer of the list before unlisting; eg. the base unlist() function would correspond to depth=0

Value

returns vectors of strings of char, lengths X

Author(s)

Nicholas Cooper njcooper@gmx.co.uk

Examples

complex.list <- list(1,1:3,list(2,2:4,list(3,3:4,list(10))),list(4,5:7,list(3)))
Unlist(complex.list,0) # equivalent to unlist()
Unlist(complex.list,1) # unlist within the top level lists
Unlist(complex.list,2) # unlist within the second level lists
Unlist(complex.list,10) # once depth >= list-depth, no difference
unlist(complex.list,recursive=FALSE) # not the same as any of the above

NCmisc documentation built on Oct. 17, 2022, 5:09 p.m.