Skip to contents

The label, and the value with its unit, such as "3 Dec 2026: 45 page views", or, for values that are no plain counts, the value as fmt writes it, such as "rwf: 1.2 MB of code".

Usage

tip_text(label, value, unit, fmt = NULL)

Arguments

label

The day, month or name of a column or bar.

value

Its value.

unit

The unit, for one and for several, such as c("page view", "page views").

fmt

A function that writes the value, such as fmt_bytes(), or NULL for a count.

Value

A character string.

Examples

rghcard:::tip_text("3 Dec 2026", 45, c("page view", "page views"))
#> [1] "3 Dec 2026: 45 page views"
rghcard:::tip_text("rwf", 1, c("star", "stars"))
#> [1] "rwf: 1 star"
rghcard:::tip_text("rwf", 1258291, c("of code", "of code"), rghcard:::fmt_bytes)
#> [1] "rwf: 1.2 MB of code"