r-markdown

How to keep figure captions in R Markdown when fig.retina is not 1

ε祈祈猫儿з 提交于 2019-12-25 02:52:19
问题 I'm having trouble with figure captions in html documents generated using R Markdown. If I don't specify the fig.retina option, or if I set it to 1, the output document has a figure caption. If I set it to a value that isn't 1, however, the future caption is missing but the text for it is present as the alt text for the figure. How can I keep the figure captions? An example: --- title: "Example" output: html_document: fig_caption: yes fig_retina: 2 --- Text text text ```{r fig.cap="Figure 1.

Include figure labels in R markdown for side by side plots

柔情痞子 提交于 2019-12-25 01:19:02
问题 In my rmarkdown document, I want to include plots side by side to save space. For example, I want to include: plot(rnorm(100)) hist(runif(100)) or plot(rnorm(100)) hist(runif(100)) I don't really care if there is one caption for both subplots or one caption for each subplot. I just really want to include figures side by side and have some way to refer to them (Figure 1, etc). Does anyone have suggestions? I have this in my header: header-includes: - \usepackage{subfig} When I don't have "fig

R looks in the wrong place for html dependency

ぃ、小莉子 提交于 2019-12-24 19:16:56
问题 I am trying to knit a flexdashboard to an html file. My flexdashboard includes leaflet maps. The knit.md file compiles correctly. At the last stage, converting the knit.md to an html file, I get an error. Apparently leaflet is looking for html dependencies in the R 3.3.2 folder, rather than the R 3.4.2 folder. I originally built this flexdashboard months ago on a different machine on which I had R 3.3.2 (although I was using 3.4.1 I believe to build this). So the problem appears to be that

R looks in the wrong place for html dependency

空扰寡人 提交于 2019-12-24 19:13:42
问题 I am trying to knit a flexdashboard to an html file. My flexdashboard includes leaflet maps. The knit.md file compiles correctly. At the last stage, converting the knit.md to an html file, I get an error. Apparently leaflet is looking for html dependencies in the R 3.3.2 folder, rather than the R 3.4.2 folder. I originally built this flexdashboard months ago on a different machine on which I had R 3.3.2 (although I was using 3.4.1 I believe to build this). So the problem appears to be that

How do I create a huxtable table caption using bookdown in rmarkdown?

我们两清 提交于 2019-12-24 19:04:05
问题 I have numerous huxtable tables in my rmarkdown. I'd like to caption them using bookdown. So far I've been unable to do this using the bookdown instructions for "other R packages to generate tables" (see URL above). Here's an example which follows the instructions in this answer: --- title: "huxtable-mwe" site: bookdown::bookdown_site output: bookdown::html_book documentclass: book --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(huxtable) library(magrittr) ``` See

Package inputenc Error & Error: pandoc document conversion failed with error 43

陌路散爱 提交于 2019-12-24 17:54:51
问题 I was trying to produce a PDF file with the knitr in RStudio but I encountered a problem. I have read a lot of solutions found on stack overflow and google but they are not very helpful. Could anyone please help me with this? Much obliged! The error is shown as below: output file: final_project.knit.md "C:/Users/JOHNL_~1/AppData/Local/Pandoc/pandoc" +RTS -K512m -RTS final_project.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output final

Inserting blank spaces at the end of a column name in a table using pander

試著忘記壹切 提交于 2019-12-24 16:35:44
问题 I am trying to find a way of centering a column heading in a pander table using knitr to pdf in rmarkdwon, but keeping the column entries right justified. --- title: "Table Doc" output: pdf_document --- ```{r table, echo = FALSE} table1 <- anova(lm(Petal.Length ~ Species*Petal.Width, iris)) names(table1) <- c("DF", "Sum Sq", "Mean Sq", "*F*", "*p*") library(pander) pander(table1, justify = c("left", rep("right", 5))) ``` There is no way to align individual cells inside a table in pandoc

r markdown error resulting from math in figure caption

醉酒当歌 提交于 2019-12-24 15:35:35
问题 I had an R markdown document that was working perfectly until I added a caption with latex math. Now I get the error: ! Argument of \reserved@a has an extra }. \par l.75 \end{verbatim}} pandoc: Error producing PDF from TeX source Error: pandoc document conversion failed with error 43 Execution halted The code below produces the error in Rstudio, Version 0.99.896, using knitr with pdflatex. Thanks!! --- title: Title goes here author: Names go here date: "\today" output: pdf_document: fig

add logo only on first (main) slide in ioslides RStudio

不羁的心 提交于 2019-12-24 13:06:59
问题 I'm using ioslides (rmarkdwon) in RStudio to create the presentation from R. I would like to add the logo, but only to the first slide (main) which renders this information: --- title: "Presentation" author: "Tom Hanks" output: ioslides_presentation logo: logo.jpg --- I don't want the logo in the bottom-left footer of each slide. Can anyone tell me how to switch it off? 回答1: You could modify the ioslide template to remove the repetition of the logo on each page. Download the template on the

part of square root latex equation dissappears in pdf rendering from RStudio's rmarkdown

可紊 提交于 2019-12-24 12:22:24
问题 When I use this code to make a square root in my pdf document (rendered by rmarkdown): --- title: "Test" author: "test test" geometry: margin=1in output: pdf_document: keep_tex: yes latex_engine: xelatex number_sections: yes toc: yes toc_depth: 3 html_document: css: tables.css number_sections: yes theme: cerulean toc: yes toc_depth: 3 header-includes: - \usepackage[dutch]{babel} - \usepackage{fancyhdr} - \pagestyle{fancy} - \fancyfoot[LE,RO]{this is a fancy foot} - \usepackage{dcolumn} -