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

Delete abstract from rticles::elsevier_article

I'd like to knit an article to a PDF document without an abstract. If I just leave out the abstract part in the YAML header, the Abstract headline is still produced in the document. Is there a way to drop this without changing the underlying…
juljo
  • 634
  • 2
  • 14
4
votes
1 answer

Can you top align a plot or image in R Markdown's flexdashboard?

--- title: "How do you top align this figure below?" output: flexdashboard::flex_dashboard --- ```{r c1, fig.width=9} plot(mtcars) ``` The R flexdashboard code above generates a plot that is centered vertically when I maximize my dashboard…
Display name
  • 4,153
  • 5
  • 27
  • 75
4
votes
1 answer

To get a huxtable in 2 pages in PDF type RMD

I have a huxtable to be printed which is at the end of the first page. Due to its size and width, the huxtable gets printed on the second page. Is there any possible way where I can split the portion of the table and project the first half of the…
Sai Anand
  • 67
  • 6
4
votes
1 answer

How to keep some space between tables in a row in knitr::kable?

I use the following code from bookdown package tutorial in R markdown file: ```{r} d1 <- head(cars, 3) d2 <- head(mtcars[, 1:3], 5) knitr::kable( list(d1, d2), caption = 'Two tables placed side by side.', booktabs = TRUE, valign =…
garej
  • 508
  • 1
  • 8
  • 24
4
votes
1 answer

How to add quotation marks in caption (bookdown)

I am having an issue with quotation marks inside captions using bookdown. The following rmarkdown doc illustrates the issue. --- title: "testdoc" author: "Dayne Filer" date: "10/21/2020" output: pdf_document: default html_document:…
dayne
  • 7,504
  • 6
  • 38
  • 56
4
votes
1 answer

Unable to resize an image in Bookdown

We have an image in hdf5 file, which we want to extract and drop it into the BookDown pdf here is the code which is doing that insertImage <- function(hdfFilepath, datasetPath) { library(rhdf5) library(magick) hdfimagedata <-…
SID
  • 99
  • 9
4
votes
2 answers

getting rmarkdown to print improved tibble printing

The pillar package offers a number of options to format tibble printing. https://pillar.r-lib.org/reference/pillar-package.html#package-options For example, this is what I see on my Windows machine, which supports these options: But when I set the…
Indrajeet Patil
  • 4,673
  • 2
  • 20
  • 51
4
votes
0 answers

kableExtra: short.caption argument does not work if several dataframes are included in one table

I have recently noticed that kable() from the kableExtra-package behaves oddly if more than one dataframe is included in the command. Short.caption argument is not used In this example, I create two data-frames and want to include them into one…
M M
  • 429
  • 5
  • 13
4
votes
1 answer

How to properly fit plotly graphs in RMarkdown html documents?

I am trying to include plotly graphs produced by timetk functions in rmarkdown html notebook but I am not sure why these plots shrink in width in the html document whereas they appear fine in rmardown source editor. To adjust the plots I have…
ViSa
  • 1,563
  • 8
  • 30
4
votes
1 answer

r markdown latex compiling error (Undefined color `gray!6') with function in jtools package

I get a compiling error when trying to render an R markdown script as pdf. Knitting the markdown file with content below with the knit button in RStudio, or running the command knitr::knit('test.Rmd'), gives an error. --- title: "Untitled" output:…
msoftrain
  • 1,017
  • 8
  • 23
4
votes
3 answers

Display long table in Rmarkdown

Is there a way to display a table with many columns nicely in rmarkdown PDF output? looking for some wrapper option to display it as say 3 consecutive tables but without breaking the data frame into 3 separate frames. Here is my chunk that makes the…
gregV
  • 987
  • 9
  • 28
4
votes
1 answer

Automatically collapsing sidebar of R Bookdown website

It is critical that people reading my Bookdown project do not skip chapters. While it is explicitly stated in the document, further discouraging this by automatically collapsing the sidebar would be really helpful :o) According to this Github issue…
snug.gy
  • 113
  • 3
4
votes
1 answer

bookdown figure number formattiing: both sequential numbering and section numbering

When using bookdown (single document), if I set both section_numbering = 'yes' and fig_caption = 'yes', the figures are numbered X.2 (where X is the section number). If section_number = 'no', the figures are numbered sequentially (Fig 1, 2 ...), but…
4
votes
0 answers

pagedown::chrome_print() extremely slow for some xaringan html slides

I'm creating pdf versions of html slides generated from R markdown files. I've come across a puzzling behaviour. When I run pagedown::chrome_print on the html with output specified as xaringan::moon_reader, the operation fails with the timeout…
kkorthauer
  • 41
  • 1
  • 3
4
votes
1 answer

How do you make output from help function display in Rmarkdown document

I have a very simple Rmarkdown document and I'm using the help function to get an overview if a dataset. When I knit the document, instead of displaying the results of the help call in the resulting HTML document a new browser page is opened with…
Mutuelinvestor
  • 3,384
  • 10
  • 44
  • 75