View source: R/60-interval_index-print.R
| print.interval_index | R Documentation |
Prints a compact summary with interval bounds and a head/tail preview of payload elements.
## S3 method for class 'interval_index'
print(x, max_elements = 4L, show_custom_monoids = FALSE, ...)
x |
An |
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 |
Invisibly returns x.
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())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.