Hide rows containing duplicate values on sort. Must be placed within reactable::colDef(style). Credit to Greg Lin, creator of reactable for writing the JS function.
Source:R/table_elements.R
group_merge_sort.Rd
Hide rows containing duplicate values on sort. Must be placed within reactable::colDef(style). Credit to Greg Lin, creator of reactable for writing the JS function.
Examples
data <- MASS::Cars93[1:20, c("Manufacturer", "Model", "Type", "MPG.city")]
## Merge unique groups in a column:
reactable(data,
pagination = FALSE,
columns = list(Manufacturer = colDef(
style = group_merge_sort("Manufacturer")
))
)
#> Error in x$width %||% settings$fig.width * settings$dpi: non-numeric argument to binary operator
## Works with columns containing numeric data as well:
reactable(data,
pagination = FALSE,
columns = list(MPG.city = colDef(
style = group_merge_sort("MPG.city")
))
)
#> Error in x$width %||% settings$fig.width * settings$dpi: non-numeric argument to binary operator