depth

0th

Percentile

Determine the number of levels in an object.

Determine the number of levels in a viewport stack or tree, in a viewport path, or in a grob path.

Keywords
dplot
Usage
depth(x, ...)
# S3 method for viewport
depth(x, ...)
# S3 method for path
depth(x, ...)
Arguments
x

Typically a viewport or viewport stack or viewport tree or viewport list, or a viewport path, or a grob path.

Arguments used by other methods.

Details

Depths of paths are pretty straightforward because they contain no branchings. The depth of a viewport stack is the sum of the depths of the components of the stack. The depth of a viewport tree is the depth of the parent plus the depth of the children. The depth of a viewport list is the depth of the last component of the list.

Value

An integer value.

See Also

viewport, vpPath, gPath.

Aliases
  • depth
  • depth.viewport
  • depth.path
Examples
library(grid) vp <- viewport() depth(vp) depth(vpStack(vp, vp)) depth(vpList(vpStack(vp, vp), vp)) depth(vpPath("vp")) depth(vpPath("vp1", "vp2"))
Documentation reproduced from package grid, version 3.4.1, License: Part of R 3.4.1

Community examples

Looks like there are no examples yet.