list.depth: Measure the depth of a nested list.

Description Usage Arguments Details Value Examples

Description

Check how many levels of nesting there are in a list.

Usage

1
list.depth(x, d = 0)

Arguments

x

[list] The list whose depth is to be gauged.

d

[integer] A technical variable, not supposed to be defined by the user. Defaults to 0.

Details

Checks how many times a list is nested. The function is recursive, but to save on execution time it doesn't have an elegant wrapper around it and has the argument d which collects the result, and which the user is supposed not to tinker with.

Value

[integer] The depth of x.

Examples

1
2
soundcorrs:::list.depth (list (1))
soundcorrs:::list.depth (list (list (1, list(2))))

soundcorrs documentation built on Nov. 16, 2020, 5:09 p.m.