Use a call to one of these functions as the heading
parameter of
overlayServer()
to provide a heading on the overlay dropdown menu
reporting the start and end position of the overlay. For numbers, the
heading from rangeHeading()
will be e.g. "1.5 - 3.5". For dates, the
heading from dateHeading()
will be e.g. "2025-05-01 - 2025-06-01".
Arguments
- ...
Further arguments to be passed to
format()
, such asdigits
,scientific
, etc. See the documentation forformat()
for details.- sep
A separator that will be inserted between the start and end position of the overlay. Use
NULL
to only print the start position.- format
For
dateHeading()
only, the date format to use, e.g. "%Y-%m-%d". See the documentation forformat.Date()
for details.
Value
A heading function suitable to pass to overlayServer()
as the
heading
argument.
See also
overlayServer()
, for a complete example.
Examples
server <- function(input, output) {
ov <- overlayServer("my_plot", 8, heading = dateHeading("%b %d"))
# further server code here . . .
}