It also helped me understand how knitr::kable(format = 'latex') produces code, which, without too much work, would allow for creating a custom Latex table function. Print(knitr::kable(my.table, format = 'latex'))ĭigging into the Latex allowed me to find a relatively easy, workable solution for side-by-side tables in rmarkdown documents. library(grid)ĬustomTable <- function(df, row.names = rownames(df), font.size = 8) ') Building a design for a table can be cumbersome, and it took me a lot of trial-and-error to come up with this custom format. The first method I found used grid graphics as outlined in the vignette from gridExtra. Side-by-side tables can be achieved in HTML by coding a table however, when using Knit PDF within RStudio, the HTML does not render correctly. In this post, I will outline several approaches I found searching through Stack Overflow, then explain a new approach using Latex. This trick displays both the text and URL.Side-by-Side Tables in Rmarkdown and LatexĪ major challenge I encountered in creating individualized reproducible reports is placing tables side-by-side. \documentclass) on paper but can see the URLs in footnotes. 17.7 Organize an R Markdown project into a research website with workflowr.17.6 Collaborate on Rmd documents through Google Drive with trackdown.17.3 Render R Markdown with rmarkdown::render().16.9 Write books and long-form reports with bookdown.16.8 R Markdown templates in R packages.16.6 The working directory for R code chunks.16.3 Read multiple code chunks from an external script (*).16.2 Read external scripts into a chunk.15.9.1 Generate data in R and read it in Asymptote.15.6.3 Write YAML data to a file and also display it.15.6.2 Include LaTeX code in the preamble.15.6 Write the chunk content to a file via the cat engine.15.3 Execute content conditionally via the asis engine.15.2 Run Python code and interact with Python.15.1 Register a custom language engine (*).14.9.3 Keep multiple copies of the cache.14.9.2 Invalidate the cache by changes in global variables.14.9.1 Invalidate the cache by changing code in the expression.14.9 A more transparent caching mechanism.14.8 Allow duplicate labels in code chunks (*).14.7 Use knitr::knit_expand() to generate Rmd source.14.6 Save a group of chunk options and reuse them (*).14.5 Modify a plot in a previous code chunk.14.4 Generate a plot and display it elsewhere.14.2 Use an object before it is created (*).14.1.2 Use the same chunk label in another chunk.14.1.1 Embed one chunk in another chunk (*).13.5 Embed an interactive 3D plot with rgl.13.4 Show the chunk header in the output.13.3 Report how much time each chunk takes to run.12.5 Output figures in the HTML5 format.11.17 Customize the printing of objects in chunks (*).11.16 Step-by-step plots with low-level plotting functions (*).11.13 Add attributes to text output blocks (*).11.12 Remove leading hashes in text output.11.11 Output text as raw Markdown content (*).11.9 Collapse text output blocks into source blocks.11.7 Hide code, text output, messages, or plots.11.5 Cache a code chunk for multiple output formats.11.3 Multiple graphical output formats for the same plot.10.3 Other packages for creating tables.10.2.4 Scaling down wide tables in LaTeX.10.1.9 Generate multiple tables from a for-loop (*).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |