set_formatter_star {rtabulator} | R Documentation |
Set star rating formatter
Description
Set star rating formatter
Usage
set_formatter_star(widget, column, number_of_stars = NA, hoz_align = "center")
Arguments
widget |
A |
column |
The name of the column the formatter is applied to. |
number_of_stars |
The maximum number of stars to be displayed.
If set to |
hoz_align |
(character): The horizontal alignment of the column. |
Value
The updated tabulator()
HTML widget
Examples
data <- data.frame(
Passengers = c("Hans", "Franz", "Ferdinand", "Julia"),
PassengerClass = c(1, 2, 1, 3)
)
tabulator(data, width = 200) |>
set_formatter_star("PassengerClass", number_of_stars = max(data$PassengerClass))
[Package rtabulator version 0.1.2 Index]