knitr

knitr chunk option eval=TRUE, echo=TRUE, include=FALSE

∥☆過路亽.° 提交于 2020-05-14 07:09:28
问题 I use RMarkdown and knitr for dynamic report generation. When knitting a document, I would like to have the code from an Rmarkdown chunk included in the knitted document and run the code -- but not show the output. That is, I would like to be able to do what this code suggests: eval=TRUE, echo=TRUE, include=FALSE ... and make knitr run the code ( eval = TRUE ), show the code ( echo = TRUE ), but not show the lengthy output (attempted with include = FALSE ), but my attempts fail. Does such an

Change line spacing for RMD abstract?

爷,独闯天下 提交于 2020-05-13 10:48:31
问题 Is it possible to change the line spacing for the abstract specified in my YAML header to single space, while leaving the rest of the document in double space? My YAML is below: output: pdf_document number_sections: true title: | | My Title author: - Me header-includes: - \usepackage{setspace}\doublespacing - \usepackage{float} abstract: "My abstract" keywords: "My keywords" date: "`r format(Sys.time(), '%B %d, %Y')`" geometry: margin=1in fontsize: 12pt spacing: double fig_caption: yes indent

Change line spacing for RMD abstract?

ぐ巨炮叔叔 提交于 2020-05-13 10:48:23
问题 Is it possible to change the line spacing for the abstract specified in my YAML header to single space, while leaving the rest of the document in double space? My YAML is below: output: pdf_document number_sections: true title: | | My Title author: - Me header-includes: - \usepackage{setspace}\doublespacing - \usepackage{float} abstract: "My abstract" keywords: "My keywords" date: "`r format(Sys.time(), '%B %d, %Y')`" geometry: margin=1in fontsize: 12pt spacing: double fig_caption: yes indent

Use additional Latex packages for math expressions in RMarkdown `output = “html_document”`

筅森魡賤 提交于 2020-05-13 05:06:49
问题 I`m aware how to use additional Latex-packages for pdf-format output from .Rmd files using --- header-includes: - \usepackage{mathtools} --- in the YAML header. However, this does (of course) not work if one specifies output: html_document . --- output: html_document header-includes: - \usepackage{mathtools} --- Using additional Latex-Packages could be of interest for output: html_document , too - especially in math expressions (MWE below) --- title: "MWE" output: html_document header

Use additional Latex packages for math expressions in RMarkdown `output = “html_document”`

别来无恙 提交于 2020-05-13 05:05:27
问题 I`m aware how to use additional Latex-packages for pdf-format output from .Rmd files using --- header-includes: - \usepackage{mathtools} --- in the YAML header. However, this does (of course) not work if one specifies output: html_document . --- output: html_document header-includes: - \usepackage{mathtools} --- Using additional Latex-Packages could be of interest for output: html_document , too - especially in math expressions (MWE below) --- title: "MWE" output: html_document header

Use additional Latex packages for math expressions in RMarkdown `output = “html_document”`

时间秒杀一切 提交于 2020-05-13 05:04:21
问题 I`m aware how to use additional Latex-packages for pdf-format output from .Rmd files using --- header-includes: - \usepackage{mathtools} --- in the YAML header. However, this does (of course) not work if one specifies output: html_document . --- output: html_document header-includes: - \usepackage{mathtools} --- Using additional Latex-Packages could be of interest for output: html_document , too - especially in math expressions (MWE below) --- title: "MWE" output: html_document header

Knitr: print text from code block as R markdown

爱⌒轻易说出口 提交于 2020-05-11 04:44:04
问题 I have the following R Markdown document: --- title: "Test" output: html_document --- ```{r cars, echo=FALSE} myCondition <- TRUE if(myCondition) { print("## Car Summary") } summary(cars) ``` When I Knit it to HTML, the "Car Summary" header is rendered in "terminal-like" monospaced font as this: ## [1] "## Car Summary" But I want it rendered as a header. How do I achieve this? 回答1: This should work for you: ```{r cars, echo=FALSE, results='asis'} myCondition <- TRUE if(myCondition) { cat("##

Is there an option to control output page orientation (using knitr->pander->pandoc->docx)

牧云@^-^@ 提交于 2020-05-10 08:45:54
问题 I am playing with Tal's intro to producing word tables with as little overhead as possible in real world situations. (Please see for reproducible examples there - Thanks, Tal!) In real application, tables are to wide to print them on a portrait-oriented page, but you might not want to split them. Sorry if I have overlooked this in the pandoc or pander documentation, but how do I control page orientation (portrait/landscape) when writing from R to a Word .docx file? I maybe should add tat I

Is there an option to control output page orientation (using knitr->pander->pandoc->docx)

两盒软妹~` 提交于 2020-05-10 08:44:08
问题 I am playing with Tal's intro to producing word tables with as little overhead as possible in real world situations. (Please see for reproducible examples there - Thanks, Tal!) In real application, tables are to wide to print them on a portrait-oriented page, but you might not want to split them. Sorry if I have overlooked this in the pandoc or pander documentation, but how do I control page orientation (portrait/landscape) when writing from R to a Word .docx file? I maybe should add tat I

Html output takes too long to load

只愿长相守 提交于 2020-05-09 07:55:32
问题 I have this html knit output from Rmarkdown but since it is pretty heavy (it is an online guide), the page takes too long to show up when opening the link. I tried to divide the rmd file into distinct rms sub files as below shown but I still can't get the result. Thank you title: "my_file" author: "me" date: "26/02/2020" output: html_document: toc: yes toc_depth: 3 toc_float: collapsed: yes smooth_scroll: yes word_document: default --- ```{r child = 'child0.Rmd'} ``` ```{r child = 'child1.Rmd