r-markdown

Rmarkdown HTML Template produces pandoc error 61

这一生的挚爱 提交于 2019-12-17 16:49:38
问题 Rmarkdown seams not working as usual after installing R3.4.3: When knitting that HTML-Template: --- title: "Untitled" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown I always get the error 'Error: pandoc document conversion failed with error 61' When setting self_contained: no in the YAML-header knitting works again Is there anything I can do to get standalone html files ? 回答1: Finally I think found a solution which works after

knitr: getting a parse_all error in R when converting Rmd file into HTML

空扰寡人 提交于 2019-12-17 16:26:09
问题 I am getting below Parsing error each time I use Knit Html in R for converting my Rmd files into HTML: Error in parse_all(input, filename, stop_on_error != 2L) : unused argument (stop_on_error != 2) Calls: ... call_block -> block_exec -> in_dir -> evaluate -> parse_all Execution halted Same result is obtained when using knitr or knitr:knit2html from the command line. Error did not exist before (I have already used Knit HTML for many .Rmd reports) but appeared when I used knit2html from the

R Markdown HTML Number Figures

谁说我不能喝 提交于 2019-12-17 16:06:52
问题 Does anyone know how to number the figures in the captions, for HTML format R Markdown script? For PDF documents, the caption will say something like: Figure X: Some Caption Text However, the equivalent caption for the HTML version will simply say: Some Caption Text This makes cross-referencing figures by number completely useless. Here is a minimal example: --- title: "My Title" author: "Me" output: pdf_document: default html_document: default --- ```{r cars, fig.cap = "An amazing plot"}

Changing font in PDF produced by rmarkdown

假装没事ソ 提交于 2019-12-17 15:24:53
问题 I am producing reports using rmarkdown. When knitting a PDF --- title: "Untitled" output: pdf_document --- I would like to specify the font to be used in creating the PDF. The official documentation (see section "LaTeX Options) says I can do this. However, I've never used LaTeX and fail to understand how such selection can be made in YAML options at the top of the .Rmd document used by rmarkdown package. Question: How do I change the font in the PDF produced by rmarkdown? sessionInfo() R

How to change the font color?

﹥>﹥吖頭↗ 提交于 2019-12-17 15:24:04
问题 In RMarkdown is there a way to specify the font color? There doesn't seem to be an option while browsing through the chunk options 回答1: The answer given at the link provided by @Ben Bolker: Roses are <span style="color:red">red</span>, violets are <span style="color:blue">blue</span>. does work if you select HTML (ioslides) as the output format. However, it does not work if you select pdf (beamer) as output format. If you want to create a pdf, use LaTeX syntax: Roses are \textcolor{red}{red},

Insert a logo in upper right corner of R markdown pdf document

我只是一个虾纸丫 提交于 2019-12-17 08:59:14
问题 I am getting started with R markdown and I would like to create a new report having our company image logo.png in the upper right corner of each page. Is there a way to code this in the YAML section or need this to be done in a R chunk section? 回答1: You can use the includes option in the yaml to specify a custom addition to your latex header. The yaml part would look like --- output: pdf_document: keep_tex: true includes: in_header: header.tex --- and you need to save a separate file called

How to hold figure position with figure caption in pdf output of knitr?

此生再无相见时 提交于 2019-12-17 07:05:55
问题 I am using knitr (1.9.5 and 1.9.17) and rmarkdown (0.5.3.1), and would like to hold figure position in the pdf output. The generated pdf file is working fine when chunk option fig.pos="H" is used. However, the figure position is not hold when fig_caption: yes is set in the yaml header. How should I fix this problem? Thanks for any suggestions. EDIT: After learning the float environment of Latex. I add float package into header. \usepackage{float} But the generated tex file always use htbp in

How to convert R Markdown to HTML? I.e., What does “Knit HTML” do in Rstudio 0.96?

隐身守侯 提交于 2019-12-17 06:26:34
问题 What commands are run when pressing "Knit HTML" on an R Markdown file in Rstudio 0.96? My motivation is that I might want to run the same command when I'm in another text editing environment or I might want to combine the command in a larger makefile . 回答1: Put Sys.sleep(30) in a chunk and you will see clearly what commands are called by RStudio. Basically they are library(knitr); knit() to get the markdown file; RStudio has internal functions to convert markdown to HTML; The second step will

For loop over dygraph does not work in R

随声附和 提交于 2019-12-17 04:02:24
问题 There is some strange behavior on dygraph . When using a for loop for dygraph i get no result. library(dygraphs) lungDeaths <- cbind(mdeaths, fdeaths) for(i in 1:2){ dygraph(lungDeaths[, i]) } On the other hand when i use lapply i do get the expected result lapply(1:2, function(i) dygraph(lungDeaths[, i])) I actually want to use the for loop in R Markdown on my own data set and iterate over the different columns, but even when i use the lapply "workaround", it does not plot the dygraphs R

Align environment in R Markdown which works for both docx and pdf output?

﹥>﹥吖頭↗ 提交于 2019-12-14 03:57:26
问题 QUESTION: In R Markdown, what is the right way to add a LaTeX align -like environment (with and without equation numbering) which will compile and display for both docx and pdf output? DETAIL: Option 1 below is what I'm going with. But I'd still like the option to have equation numbering and not give up that functionality when I move between docx and pdf output. This compiles and displays in both docx and pdf output. Hooray! But what if I want equation numbering? \[ \begin{aligned} AR(p): Y_i