Skip to content

Instantly share code, notes, and snippets.

@bryanmayer
Created February 5, 2018 18:07
Show Gist options
  • Save bryanmayer/082a92d43a1fb58108b4b456b502b55a to your computer and use it in GitHub Desktop.
Save bryanmayer/082a92d43a1fb58108b4b456b502b55a to your computer and use it in GitHub Desktop.
wrapper for using xtable and print.xtable. Does not handle long tables.
print_xtable = function(table_in,
caption = "FILL IN CAPTION",
digits = NULL,
align = NULL,
include.rownames = F,
comment = F,
sanitize.text.function = function(x) x,
xtable.options = NULL,
return_xtable = F,
...){
tex_table = do.call("xtable", c(list(table_in, caption = caption, digits = digits, align = align),
xtable.options))
if(return_xtable) return(tex_table)
print(tex_table,
sanitize.text.function = sanitize.text.function, include.rownames = include.rownames,
...)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment