Formatting tables with R for LaTeX and HTML
Use devtools
for easy installation:
devtools::install_github('SwedishPensionsAgency/format.tables')
x <- format.tables(data=head(cars, 3),
styles=rep("plain", 3),
column.names = names(cars),
names.style = "header",
header=list(caption = "Caption", subcaption="subcaption")
)
cat(x$render(type="tex"))