r-markdown

rmarkdown: pandoc: pdflatex not found

痞子三分冷 提交于 2019-12-03 04:04:17
问题 When I use the render{rmarkdown} to produce pdf file from .Rmd file on my Mac, an error message says pandoc: pdflatex not found. pdflatex is needed for pdf output. Error: pandoc document conversion failed However when I check with pdflatex -v I got pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012) kpathsea version 6.1.0 Copyright 2012 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the

output markdown in r code chunk

半腔热情 提交于 2019-12-03 03:58:09
I have a R markdown file that I want to output rmarkdown from the script itself. For example, I would have the following simple code in an Rmd file. --- title: "test" author: "johndoe" date: "September 5, 2015" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r cars} paste("## This is a Heading in Code") summary(cars) ``` I want "This is a Heading in Code" to render in rmarkdown. There is a solution in an R script to generate markdown as per http://rmarkdown.rstudio.com/r_notebook_format.html . But I am trying to figure out how to do this in a

Edit title slide of R Markdown Slidy Presentation

。_饼干妹妹 提交于 2019-12-03 03:50:36
Is there a way to edit the title slide of a R Markdown Slidy Presentation? I am able to add the header, footer, and custom css: title: "Slidy Template" author: "" date: "June 18, 2015" runtime: shiny output: slidy_presentation: css: ./styles/Slidy_Styles.css includes: after_body: ./styles/doc_suffix.html before_body: ./styles/header.html But I can't figure out how to either add anything besides title, author, and date to the slide, or else replace the standard slidy title slide with a custom html template, like I do with the header and footer. Is there a way to do this? You can modify the part

rChart in R Markdown doesn't render

对着背影说爱祢 提交于 2019-12-03 03:49:54
I am having issues rendering an rChart made with 'nPlot' when I knit an R Markdown document to html. I followed the solution discussed in this question , but it was unsuccessful. Here is my .Rmd code ```{r, echo=FALSE} library(knitr) ``` --- title: "Untitled" author: "Test" date: "01/23/2015" output: html_document --- This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. When you click the **Knit** button a document will be generated that includes both

How to suppress automatic figure numbering in Rmarkdown / pandoc

主宰稳场 提交于 2019-12-03 03:25:59
I have the following Rmarkdown (.Rmd) document where I call existing .png images and create a .pdf with captions. By default, pandoc? is automatically adding "Figure #." before the caption for each picture. I can see how this would be the normal thing to do, but in my case I would like to define this. I have found variations on this topic but don't seem to find a solution. Below is an example of how my .Rmd file looks: --- title: "TITLE" author: "ME" date: "`r Sys.Date()`" output: pdf_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ![Caption for figure 1]

Conditional formatting tables in RMarkdown documents

大憨熊 提交于 2019-12-03 03:09:06
As an example, I might want to use the following rule to color the cells: (edited to un-trivialize) Blue if > 4 No fill if <= 4 and >= 3.5 Yellow if >= 3 and < 3.5 Orange if < 3 Create tables with conditional formatting with RMarkdown + knitr doesn't help me because I don't just want to highlight cells satisfying one set of criteria. Example rmd: --- title: "Untitled" output: html_document --- ```{r, message = FALSE, results = "asis"} library(knitr) library(dplyr) head(iris) %>% kable ``` I'll take a solution utilizing DataTables if that's what it takes Victorp Hello here a solution using

How to insert plain picture (jpeg / png) from chunk with knitr

≯℡__Kan透↙ 提交于 2019-12-03 02:56:51
I want to insert a picture at the beginning of text using a code block, not markdown. I am using the Tufte handout template output: rmarkdown::tufte_handout and when I insert it straight after the YAML header but before TOC like this: \centering ![width='100%'](./cropped-banner_efpt.jpg) \raggedright \tableofcontents \clearpage the image then spans the main body. I know that with chunks there is an option to have the chunk to span the whole page placing fig.fullwidth = TRUE in the chunk header, but I am a bit stuck with this as I am not generating any graph from data and I do not know how to

Create appendix with R-code in rmarkdown/knitr

可紊 提交于 2019-12-03 02:33:40
Is it possible to get all of the code in a appendix. Say I have two chunks in a document and then some text. ```{r, echo=TRUE} x <- 4+5 x ``` Above is X output. ```{r, echo=TRUE} y <- 22+325 y ``` Above is Y output. And then I want all of the code in a appendix but shown as if I put eval=FALSE in the chunk. Something like this ```{r, SHOW_ALL_CODE=TRUE} ``` Expected output: Chunk_1 y <- 22+325 y Chunk_2 x <- 4+5 x Thierry knitr::purl() can extract all R code from a markdown file into an R script. You can add that as an appendix. ## appendix ```{r code=readLines(knitr::purl('~/path/to/file.Rmd'

changing font size in R DataTables (DT)

北战南征 提交于 2019-12-03 02:31:27
Have been trying to change the font size of all text in the tables generated by DT. However, I could only figure out how to change the size of the records using formatStyle(names(datCalc), fontSize = '12px') . The column headers and buttons have text of the same size. Using R Markdown in RStudio. I think you almost got there. I solved it by explicitly telling DT::formatStyle() which columns I wanted. I first tried using the names() or colnames() approach, as you did. For some reason this didn't work: iris %>% DT::datatable() %>% DT::formatStyle(columns = colnames(.), fontSize = '50%') However,

multiple authors and subtitles in Rmarkdown yaml

纵然是瞬间 提交于 2019-12-03 02:12:53
问题 I'm trying to follow this pandoc example to add multiple authors to an Rmarkdown file in the yaml metadata block. The pdf will generate in RStudio (Version 0.98.932), but there is no author information. --- title: 'This is the title: it contains a colon' author: - name: Author One affiliation: University of Somewhere - name: Author Two affiliation: University of Nowhere date: "`r format(Sys.time(), '%d %B %Y')`" tags: [nothing, nothingness] abstract: | This is the abstract. It consists of two