Last active
April 8, 2016 16:27
-
-
Save nutterb/8a5e39544df395f6f4198e520580a80f to your computer and use it in GitHub Desktop.
A LaTeX safe approach to applying borders to all cells using pixiedust
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
medley_all_border <- function(x, part = c("table")) | |
{ | |
part <- | |
match.arg(part, | |
c("table", "head", "body", "interfoot", "foot"), | |
several.ok = TRUE) | |
part <- | |
if ("table" %in% part) | |
{ | |
c("head", "body", "interfoot", "foot") | |
} | |
for (i in part) | |
{ | |
if (!is.null(x[[i]])) | |
{ | |
part_rows <- max(x[[i]][["row"]]) | |
part_cols <- max(x[[i]][["col"]]) | |
x <- sprinkle(x, | |
rows = 1:part_rows, | |
cols = 1:part_cols, | |
border = c("left", "bottom"), | |
part = i) | |
x <- sprinkle(x, | |
rows = 1, | |
border = "top", | |
part = i) | |
x <- sprinkle(x, | |
cols = part_cols, | |
border = "right", | |
part = i) | |
} | |
} | |
x | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment