Skip to content

Instantly share code, notes, and snippets.

@briandconnelly
Created May 2, 2018 23:21
Show Gist options
  • Save briandconnelly/e58b2e51ed15419d9719fa74552a109c to your computer and use it in GitHub Desktop.
Save briandconnelly/e58b2e51ed15419d9719fa74552a109c to your computer and use it in GitHub Desktop.
Format an R dataframe for pasting into a Jira ticket
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