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
1 answer

Using kableExtra() breaking hyperlinks in my Latex tables

I'm outputting a table to PDF via Rmarkdown, and I'm trying to add a hyperlink into my table. It works using markdown syntax when I use kable(), but when I add any styling using kableExtra the hyperlink goes away. Below is an example: This…
redarah
  • 152
  • 7
4
votes
0 answers

Avoid overlapping columns with kable

I'm developing an R Markdown script (whose output must be pdf_document) to generate a report with graphs and tables of a database data (I get this data through API calls) and I don't know how to avoid column overlapping when I get long…
4
votes
1 answer

Using {.tabset} with bookdown::bs4_book()

I'm creating a {bookdown} project using the new bookdown::bs4_book() output. However, when I try to add tabs to a chapter using {.tabset} as described here, the tabs are not generated. Instead, the document is rendered in the normal linear…
Jake Thompson
  • 2,591
  • 1
  • 16
  • 32
4
votes
1 answer

rmarkdown/purrr: remove list indices between plots

When I knit a document containing multiple plots obtained through purrr:map function, I get text slides in between each plot slide containing unwanted list index information (see image slides 2, 4, and 6). I'd like to remove these and just have…
datakritter
  • 590
  • 5
  • 19
4
votes
0 answers

Producing html and pdf from a bookdown

I currently have a few bookdown projects which are hosted as Github.io projects. Across these projects I use custom defined css styling for chunks, which allow for code folding boxes and coloured notes. I'd like to be able to render these projects…
Oska Fentem
  • 135
  • 6
4
votes
1 answer

How to align a math equation correctly in rmarkdown?

I've tried to searching online how to align my equation properly, but it still looks like right aligned rather than all the equal signs are aligned, can you help? The below is my code in…
Subaru Spirit
  • 394
  • 3
  • 19
4
votes
2 answers

Rmarkdown - python inline code in Rmarkdown

I am using Rmarkdown with python. What is the equivalent of the R inline code for python? Example, in https://rmarkdown.rstudio.com/lesson-4.html I can do ``r x` to display the value of x in the text. but If I do ``python x` I just get the text…
Courvoisier
  • 904
  • 12
  • 26
4
votes
1 answer

In Rmarkdown, is there a way to create a .bib file for only those keys cited in a document?

I have written a manuscript using bookdown in Rstudio for a specific project that cites references from a bibtex file. This is a single .bib file that I use for many documents, so it is outside my project folder and contains many references that…
tellis
  • 152
  • 6
4
votes
1 answer

How can I save a networkD3::sankeyNetwork() into a static image automatically via rmarkdown?

When I write a report in rmarkdown, all my figures as save automatically under the folder graphs. However, as a Sankey diagram is different, it does not save as a picture (.png, etc...) automatically. Is there a workaround for this? (without…
4
votes
1 answer

R Markdown: Change plot font size when knit to HTML?

I'm using R Markdown to create an HTML document with various plots in ggplot2. However, the font size shrinks considerably whenever I knit to HTML compared to when I knit to a GitHub document. I've tried knitr::opts_chunk$set(dev.args =…
Kate Ham
  • 143
  • 6
4
votes
1 answer

How to have buttons and a "Show Entries" using Datatables (DT) in Rmarkdown?

I'm trying to make a table that has both shows entries and buttons so my peers can export the data from the table. At first when I added the tables it covered the "Show Entries" section that is usually on the top left. So I wrote this CSS code which…
RL_Pug
  • 697
  • 7
  • 30
4
votes
1 answer

Format data to create neat table in R markdown using kable

I want to create a neat table in R markdown using the kable package, but my data need to be transformed. My data look like this: category <- c('population', 'population', 'sample', 'sample', 'population', 'population', 'sample', 'sample') gender <-…
johnny
  • 423
  • 3
  • 10
4
votes
1 answer

Knitr is ignoring tabs in HTML theme

I am new to R markdown and tried to use it on my computer at work. However, I was not able to change the theme or add tabs. On my personal computer, however, everything works and I get pretty HTML documents. I used the markdown document that opens…
CST
  • 207
  • 1
  • 6
4
votes
1 answer

Problem knitting Rmd with vitae package, multiple-bibliographies.lua error

When attempting to knit my vitae from Rmd using the vitae package I am seeing the following error: Error running filter /tmp/RtmpLl0xn9/multiple-bibliographies.lua: /tmp/RtmpLl0xn9/multiple-bibliographies.lua:34: attempt to compare string…
Dan Prisk
  • 41
  • 1
4
votes
4 answers

Error in loadnamespace when knitting R_markdown to PDF

This is the first time I use R_Markdown I created a new R_Markdown and am trying to knit it to PDF. When I do it I get the following error processing file: R_markdown.Rmd |.......... | …
FrAiello
  • 73
  • 1
  • 1
  • 7