depth | R Documentation |
Functions to extract the 'depth' of an object
depth(x, ...)
## Default S3 method:
depth(x, ...)
## S3 method for class 'list'
depth(x, ...)
x |
An object |
... |
Possible additional arguments passed to methods (not in use) |
This function does not count an empty lists (list()
) as a level or NULL
objects.
A single integer
a <- c(1, 2, 3)
depth(a) # Vectors are 1L
b <- list(a = 1, b = list(list(1)))
depth(b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.