View source: R/50-ordered_sequence-print.R
| print.ordered_sequence | R Documentation |
Prints a compact summary and head/tail preview in key order.
## S3 method for class 'ordered_sequence'
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.
xs <- ordered_sequence(one = "a", two = "b", three = "c", keys = c(20, 30, 10))
print(xs, max_elements = 4)
sum_key <- measure_monoid(`+`, 0, function(entry) as.numeric(entry$key))
ys2 <- add_monoids(ordered_sequence("a", "b", keys = c(2, 1)), list(sum_key = sum_key))
print(ys2, max_elements = 0, show_custom_monoids = TRUE)
ys <- ordered_sequence("x", "y", "z", keys = c(2, 1, 3))
print(ys, max_elements = 3)
print(ordered_sequence())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.