There are currently two colors in use, namely iblue and igray. In the case you want to use other dimensions, you need to hack the tex file defs.tex in order to make it look nice. The cover should have 1654 x 2339 pixels. The recommended dimension for the logo is 350 x 130 pixels. Keep in mind to either name your files exactly like mine or to correct the file names in the yaml header. You can overwrite logo.png and cover.png in this folder with your own files. ![]() When you create a new R Markdown file from the template, RStudio creates a new folder in your working directory (check with getwd()). So, when you create a new table, all you have to do is to create the xtable object tab in the first row, making sure that the align has the right number of columns specified. The add.to.row option in print() enables me to put a code snippet into the latex code wherever I like by specifying a command and a position in a separate list, here called addtorow. I color the header via a latex code snippet which is placed in the header of the latex table code. Make sure to edit the align option as the number of columns changes. With xtable() I create an object tab of class xtable. This code snippet consists of three parts: tab <- xtable ( head (iris, n = 20 ), align = "|C|C|C|C|C|C|" )Īddtorow $ command <- c ( " \\ rowcolor" ) It renders a table from the iris data set. In order to generate tables in MS Word style you can use the example code snippet below. You can write text and add graphics just like you would in any other R Markdown document. This is what the default report looks like: As result a new Rmd script pops up and you can knit it right away. > From Template > INWTlab Business Report and then clicking OK. Once the package is installed, you can already use the template in its default version by selecting R Markdown. # install.packages("devtools")ĭevtools :: install_github ( "INWTlab/ireports" ) If you haven't installed devtools yet, please do that first. You can install the package from the INWTlab Github Repository ireports. In my eyes a tex file is way easier to hack - especially for not so experienced latex users - than style files (. In addition, this template can be extended by hacking the tex file defs.tex. In many companies nowadays MS Word is still THE reporting tool, so the overall look and feel is loosly oriented at MS Word defaults. That is, I want to have a logo included and a cover page that also can be styled in a corporate design. I know there are quite a few templates available, but I was missing one to be used in a corporate environment. ![]() It's been my aim to have a nice and clean template that is easy to customize in colors, cover and logo. In this post I'd like to introduce the R Markdown template for business reports by INWTlab.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |