Questions tagged [r-markdown]

R Flavored Markdown or "R Markdown" is a markdown variant used for content-creation and/or programming documentation interleaved with R code.

R Flavored Markdown, or simply "R Markdown", is a markdown variant used for content-creation and/or programming documentation in which text content is interleaved with R code. It is a modern example of literate programming and is frequently used in R vignettes and README files where an R Markdown file (usually with file extension .Rmd) is rendered as HTML via knitr pre-processing of embedded code chunks.

More details about R Markdown can be found in:

Two R packages currently implement R Markdown rendering:

Various script editors can display R Markdown documents with syntax highlighting and render the resulting markdown and HTML documents, including:

  • RStudio, a popular R IDE
  • Rcmdr, a graphical user interface available as an R package
10493 questions
4
votes
2 answers

RMarkdown package flextable fails immediately with "read_docx only support docx"

I'm sorry for a minimally produced question...... not lots of information because it just fails the first time I'm ever trying with this and I am not very skilled in RMarkdown debugging yet. I'm trying flextable for the first time (interested in…
Mike M
  • 1,382
  • 11
  • 23
4
votes
0 answers

How can I override default pandoc options using yaml header to specify Github Markdown in rmarkdown?

I'm trying to use Github Formatted Markdown(GFM) to generate an MS Word document. From the pandoc documentation : --from gfm will do what I want. But when I specify it in my yaml header, it adds it but doesn't remove the default --from parameter…
majorgear
  • 311
  • 3
  • 12
4
votes
2 answers

Making full-slide sized ggplot2 output {Xaringan}

Is there a way to make a ggplot graph take all the slide with {xaringan} presentation? I can do that if i export it to .png and place it as a background picture. But what about directly from chunk output?
Alberson Miranda
  • 1,248
  • 7
  • 25
4
votes
1 answer

Displaying RMarkdown HTML output in the CANVAS LMS

I am trying to display R code and output in the CANVAS LMS (specifically within a page, not just as a separate html file). I have had no joy Googling this so hopefully someone can help. What I have tried (as a simple test) but hasn't worked: In…
4
votes
1 answer

How to have R markdown templates share the same set of supporting files?

I have an R package that has 4 markdown templates that can be used to knit HTML documents after installation. These templates share the same set of supporting files (css, images, scripts, html files, ... - about 6 MB of files). RStudio's R Markdown…
Paul
  • 2,877
  • 1
  • 12
  • 28
4
votes
0 answers

Output by for loop of DT::datatable with Rmarkdown

I want to output datatable several times using for loop on Rmarkdown. test.Rmd --- title: "test" output: pdf_document --- ```{r, include=TRUE, echo=FALSE, comment=NA, results='asis'} library(DT) n <- 1 for (i in 1:3) { dat <-…
Tim Ikata
  • 201
  • 1
  • 7
4
votes
1 answer

Add a superscript to one cell of a table formatted with kable / kableExtra for Rmarkdown

I have a footnote in a table formatted with kable and kableExtra for an Rmarkdown-generated pdf. I need NYC to have the superscript (NYC^1) to point to the footnote, but can't figure out how to do it. Any suggestions? df <-…
Emilio M. Bruna
  • 297
  • 1
  • 3
  • 14
4
votes
1 answer

Knit & rmarkdown::render() producing different results (kable format; PDF)

I have some Rmarkdown documents I am trying to knit/renderas PDF files. I want to get render to work properly because I am going to run this in a script with multiple Rmd files as well as a lot of other processes (e.g. data grabs &…
TTS
  • 1,818
  • 7
  • 16
4
votes
0 answers

Text wrapping in code sections using Tufte format

Text in the code section of a Tufte formatted, Rmarkdown document does not seem to wrap. I have tried several options and suggestions, but nothing works. I am guessing that all of the other suggestions I could find on StackOverflow did not work,…
Mark Bower
  • 569
  • 2
  • 16
4
votes
2 answers

stargazer error "length of NULL cannot be changed" when running rchunk in rmarkdown only

I teach econometrics using Rmarkdown on my university's rstudio pro server, running R 3.6.3. Whenever I run an rchunk using stargazer to display regression results, I get a preamble of errors before the table. Here is a copy and paste of the code…
B Haney
  • 41
  • 1
  • 3
4
votes
1 answer

Using custom LaTeX class changes numbering in R Markdown

I recently discovered that you can include your own LaTeX class in an R-Markdown doc to change the appearance of the PDF. Here is a minimal example: R Markdown --- title: "Test" date: "`r format(Sys.time(), '%d %B, %Y')`" documentclass:…
JBGruber
  • 11,727
  • 1
  • 23
  • 45
4
votes
2 answers

Cross Tabulation with R Markdown

I have struggle creating a simple nice looking cross tabulation for a PDF knitted R Markdown document. I have a data set that is similar to this example: library(tidyverse) fakeData <- tibble(id = c(1,2,3,4,5,6,7,8,9,10), bmi =…
ludo
  • 169
  • 1
  • 12
4
votes
0 answers

Cannot knit Markdown doc using the {flair} package - "Could not find function viewer"

I'm trying out the flair package within a markdown document, and I'm having trouble knitting a document as shown in the package's announcement page. Here's a basic .Rmd example using code from that page: --- title: "test" output:…
Phil
  • 7,287
  • 3
  • 36
  • 66
4
votes
0 answers

How to change the output of a knitr chunk with bash engine

When running knitr::knit() in a Rmd file with this: ```{r setup, include=FALSE} knitr::opts_chunk$set(collapse = TRUE) ``` ```{bash} which R which bash ``` The output (a md file) is ```bash which R which bash ## /usr/local/bin/R ##…
4
votes
1 answer

Knitr doesn't find function from previous chunk when using custom knit function and evaluating quoted function in a list

I've been running into strange cases where knitting an R markdown document fails when a chunk is unable to find a function that was defined in a previous chunk. I isolated one of them below (the most I could) and this is how it fails: runs with no…
rcarboni
  • 43
  • 5