do_multirow: Combine rows with the same content

Description Usage Arguments Value Examples

View source: R/do_multirow.R

Description

Combine rows with the same content

Usage

1
do_multirow(df, cols = 1:ncol(df), cmidrule = TRUE)

Arguments

df

[data.frame]
data.frame object of which to combine rows with same content to multirows.

cols

[integer]
Vector of column indices to apply multirow combination to.

cmidrule

[flag]
Should cmidrules inserted between groups of combinations?

Value

A data.frame with multirow(s) inserted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
df <- data.frame(FIRST = rep("A", 28), 
                 SECOND = c(rep("A", 4), rep ("B", 6), rep("A", 8), rep("B", 10)), 
                 THIRD = rep(c(LETTERS[0:13 %% 24 + 1]), each = 2), 
                 FORTH = LETTERS[0:27 %% 24 + 1])

print(
  xtable(
    do.multirow(df, cols = 1:3)), 
  booktabs = TRUE, 
  sanitize.text.function = identity, 
  include.rownames = FALSE
)

## End(Not run)

imbs-hl/imbs documentation built on Sept. 6, 2019, 11:05 p.m.