Created
May 2, 2018 23:21
-
-
Save briandconnelly/e58b2e51ed15419d9719fa74552a109c to your computer and use it in GitHub Desktop.
Format an R dataframe for pasting into a Jira ticket
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
kable_jira <- function(x, ...) { | |
# Ideal solution would be to use knitr:::kable_mark, but... | |
res <- knitr::kable(x = x, format = "markdown", ...) | |
res[[1]] <- stringr::str_replace_all( | |
string = res[[1]], | |
pattern = "\\|", | |
replacement = "\\|\\|" | |
) | |
# Remove the second line | |
structure(res[-2], format = "markdown", class = "knitr_kable") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment