Learn R Programming

spup (version 1.2-1)

list_depth: Function to find the level of list nesting

Description

Function to find the level of list nesting

Usage

list_depth(List)

Arguments

List

an object of class 'list'.

Value

an integer; level of list nesting

Examples

Run this code
# NOT RUN {
a <- list(1,2)
list_depth(a)

a <- list(list(1, 2), 3)
list_depth(a)

# }

Run the code above in your browser using DataLab