Allow non-scalar values of align in header
Function add_header_above now accepts non-scalar values for the align argument. add_header_above checks whether length(align) == 1L or is the same length as the header. Otherwise uses default centering of each column in the header row.
diff --git a/R/linebreak.R b/R/linebreak.R
index 54d7cae..3bc0d51 100644
--- a/R/linebreak.R
+++ b/R/linebreak.R
@@ -14,7 +14,7 @@
linebreaker = "\n") {
if (is.numeric(x) | is.logical(x)) return(x)
x <- as.character(x)
- align <- match.arg(align, c("l", "c", "r"))
+ align <- vapply(align, match.arg, 'a', choices = c("l", "c", "r"))
if (double_escape) {
ifelse(str_detect(x, linebreaker),
paste0("\\\\makecell[", align, "]{",