Learn R Programming

thisutils (version 0.3.1)

max_depth: Maximum depth of a list

Description

Maximum depth of a list

Usage

max_depth(x, depth = 0)

Arguments

x

A list.

depth

The depth of the list.

Examples

Run this code
x <- list(
  a = list(b = list(c = 1)),
  d = list(e = list(f = 2))
)
max_depth(x)

Run the code above in your browser using DataLab