depth {mark}R Documentation

Depth

Description

Functions to extract the 'depth' of an object

Usage

depth(x, ...)

## Default S3 method:
depth(x, ...)

## S3 method for class 'list'
depth(x, ...)

Arguments

x

An object

...

Possible additional arguments passed to methods (not in use)

Details

This function does not count an empty lists (list()) as a level or NULL objects.

Value

A single integer

Examples

a <- c(1, 2, 3)
depth(a) # Vectors are 1L

b <- list(a = 1, b = list(list(1)))
depth(b)

[Package mark version 0.7.0 Index]