r-markdown

Company logo in PDF output only on the first page

不打扰是莪最后的温柔 提交于 2019-12-10 11:18:14
问题 I was wondering if there is a way to include the company logo to a PDF document created by R Markdown only on the first page of the document . I have searched for an answer and the closest I could find is this. There are multiple solutions presented in the answers, however, neither of them works for me because they either: include the logo at every page of the document (not just first); or include the chapter title in the header (and a horizontal line below it) along with the logo. I am

How to add a watermark image on rmarkdown?

不想你离开。 提交于 2019-12-10 11:08:57
问题 I'm searching and trying to add a image as watermark to rmarkdown pdf, I'm using the render function to generate the PDFs, and saw the \usepackage{draftwatermark} and this question: Watermark in rmarkdown But they don't help me in adding a image as watermark. --EDIT-- I achieved what I wanted putting this to the header of .Rmd: header-includes: - \usepackage{eso-pic,graphicx,transparent} And placing this in the start of file (before the rest of .Rmd): \AddToShipoutPictureFG{ \put(0,0){%

Generate formattable widgets in a loop in an R markdown document

╄→尐↘猪︶ㄣ 提交于 2019-12-10 10:53:30
问题 I want to put HTML widgets like formattable (from formattable package) in an HTML page generated through RMarkdown. I need the widgets to be generated from within a for loop. How can i do that? With or without print() , both don't work. This is an example code (partly taken from formattable homepage): --- title: "formattable example loop" output: html_document --- ```{r} library(formattable) df <- data.frame( id = 1:10, name = c("Bob", "Ashley", "James", "David", "Jenny", "Hans", "Leo", "John

how to align kable and ggplot in one row (side by side) in r markdown?

自古美人都是妖i 提交于 2019-12-10 10:30:01
问题 I am trying to knit an r markdown file to pdf , but I can't align ggplot and kable in one row. I have tried following ways: cat("\twocolumn") kable_styling(position = "float_right") Below is a minimal, reproducible example --- title: "Untitled" output: pdf_document classoption: landscape --- \newpage ```{r cars, echo=FALSE, fig.width=3, fig.height=3, results="asis", message=FALSE} library(dplyr) library(knitr) library(kableExtra) library(ggplot2) dt <- split(mtcars, f = mtcars[, "cyl"]) %>%

In RMarkdown Word document, how to make table of contents appear later

二次信任 提交于 2019-12-10 10:29:25
问题 When an RMarkdown document is knit to Word, the Table of Contents (if there is one) always appears at the beginning of the document. If I want to, say, make the Table of Contents appear on the second page of the document, how do I do so? If I was knitting to HTML I could use this method, but it doesn't seem to work for Word. Meaning, I create a Word template to be used in the reference_docx YAML argument and put the Table of Contents at the bottom of this template, but when I knit a report

how to add grid to table with pander?

守給你的承諾、 提交于 2019-12-10 09:31:21
问题 I am working with R, knitr and pander, and I can't find the option that would allow me to print a grid on a table with pander. I tried : pander(tableToPrint, style='grid') but it doesn't do anything, neither with this option or with 'multiline', 'rmarkdown'... I always get an horizontal line, then the column names, another horizontal line, all my data and an horizontal line. I would like to have an horizontal line between every line. Another option would be to alternate row colors. 回答1: There

Using an R Markdown Document as a source for functions

谁说胖子不能爱 提交于 2019-12-10 07:22:13
问题 I'm looking into R Markdown for documenting functions I regularly use. I will put them into an R Markdown file to document them and then be able to read my thinking behind the function if i come back to it months later My question is, if i start a new R project, Is it possible to source the r markdown file and use the library of functions i have created just by calling them similarly to if i was sourcing a regular R file. I dont really wish to maintain two sets of function files I appreciate

how to include an abstract in a rmakdown Rmd file

ε祈祈猫儿з 提交于 2019-12-10 05:01:10
问题 In a .Rmd file with the header below, I want to include an abstract, so I tried the standard LateX article form, \abstract{This paper explores a variety of topics related to the question of testing the equality of covariance matrices in multivariate linear models, particularly in the MANOVA setting. The main focus is on graphical methods that can be used to understand features of data related to this question.} But, surprisingly (I know this seems weird), the references in my References

How can I create a self-contained html report with rmarkdown?

社会主义新天地 提交于 2019-12-10 04:24:37
问题 How can I produce an html document from a .Rmd file, with self-contained images? I am using the bsplus package along with rmarkdown to create a carousel of images. It works perfectly when I open the .html output within the .Rproj working directory, but the images are no longer displayed when I send the file to someone. Would it be possible to get a "self-contained" .html file output with the corresponding images? or should I send also all folder dependencies? Example of how the code looks

Knitr preamble error results in “pandoc document conversion failed with error 43”

冷暖自知 提交于 2019-12-10 02:56:23
问题 Rstudio Version 0.99.441; Windows 7 enterprise; knitr 1.10.5; MiKTex 0.4.5 r.1280 (2.9 64-bit) I have a an error on my office computer when trying to knit PDF's in Rstudio, there are no problems knitting to HTML or word. The problem may be related to updates because knitting used to work fine and my home computer can knit to pdf without issue, however I took my computer home to update and the problem is still there. My error message was as follows "pandoc.exe: Error producing PDF from TeX