print.interval_index: Print an Interval Index Summary

View source: R/60-interval_index-print.R

print.interval_indexR Documentation

Print an Interval Index Summary

Description

Prints a compact summary with interval bounds and a head/tail preview of payload elements.

Usage

## S3 method for class 'interval_index'
print(x, max_elements = 4L, show_custom_monoids = FALSE, ...)

Arguments

x

An interval_index.

max_elements

Maximum number of elements shown in the preview.

show_custom_monoids

Logical; show attached non-default monoids and their root cached measures.

...

Passed through to per-element print().

Value

Invisibly returns x.

Examples

ix <- interval_index(
  one = 1, two = 2, three = 3,
  start = c(20, 30, 10), end = c(25, 37, 24)
)
print(ix, max_elements = 4)
width_sum <- measure_monoid(
  `+`, 0, function(entry) as.numeric(entry$end - entry$start)
)
ix3 <- add_monoids(
  interval_index(1, 2, start = c(1, 3), end = c(2, 5)),
  list(width_sum = width_sum)
)
print(ix3, max_elements = 0, show_custom_monoids = TRUE)

ix2 <- interval_index(1, 2, 3, start = c(2, 4, 6), end = c(3, 5, 8), default_query_bounds = "[]")
print(ix2, max_elements = 3)

print(interval_index())

Immutables documentation built on April 29, 2026, 1:06 a.m.