View source: R/collapse_group_row.R
collapse_group_row | R Documentation |
This function is for replacing repeated rows in a data.frame into NA for nice printing. This is not intended for use during processing.
collapse_group_row(.data, ..., reorder_cols = TRUE)
.data |
a data.frame |
... |
Columns to use to identify which to rows to replace with NA's |
reorder_cols |
if |
a data.frame where repeated rows in the columns identified by ... are replaced with NA
sample_df <- data.frame(
x = c(1, 1, 1, 2, 2, 2, 2),
y = c('test1', 'test1', 'test2', 'test1', 'test2', 'test2', 'test1'),
z = c(1, 2, 3, 4, 5, 6, 7),
outputVal = runif(7)
)
library(dplyr)
options(knitr.kable.NA = '')
collapse_group_row(sample_df, x, y, z) %>%
kableExtra::kable() %>%
kableExtra::kable_styling()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.