Newest 'r-markdown' Questions - Stack Overflow

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.

0
votes
0answers
11 views

How to add a footnote to pack_rows text?

I'm trying to add a footnote to a table with a row that spans multiple columns using knitr + kableextra + pack_rows Searching for solutions I have come up empty, other than the "make sure you use ...
0
votes
0answers
6 views

Outputting the results from bife object to Latex in Rmarkdown?

I'm estimating a fixed-effects probit model using the bife package in R. I'm trying to extract the output into something I can use with either stargazer or texreg so I can output them into a paper ...
2
votes
1answer
40 views

How to write code and view results at the same time?

I am trying to create a rmarkdown document for monthly reports. The issue I have is writing code and trying to visualize what the result would look like in the final document. I can generate and view ...
1
vote
0answers
16 views

markdown: use HTML code to render pdf output?

Is there way to use html codes like div for R markdown rendered to pdf? Here is an example. --- pdf_document: fig_caption: yes toc: yes output: pdf_document always_allow_html: yes --- ```{r ...
0
votes
0answers
8 views

My items and indentation are not rendering properly

I was trying to write some items with some code between them, like the example below 1. Line 1 ```{r} (1+1) ``` i) Item 1 ```{r} (1+1) ``` ii) Item 2 But ...
0
votes
3answers
20 views

How should I source custom functions into a RMardown file?

I often have custom functions saved in a R script that I load into the environment using source(functions.R) at the beginning of an R script. Let's say I now want to create a RMarkdown doc to ...
0
votes
0answers
8 views

How to create doubly-nested tabs in R Markdown?

I would like to create an R Markdown HTML document with doubly-nested tabs. I have tried to extend the method given as an answer for the question RMarkdown can't seem to produce Tabs in Tabs with ...
0
votes
0answers
24 views

How to I fix this markdown knitting error I get after updating R?

I have looked at Rmarkdown HTML Template produces pandoc error 61 and tried inputting "self_contained: no" into my code but that did not work. I have looked in the location and default.html does ...
0
votes
1answer
17 views

Adding image to flextable and generate my flextable in Word document using Rmarkdown

First, I'm using R 3.6.0 and Rstudio 1.2 with Windows 10. I am using flextable and Officer to create a Word document. Into this table I insert some images. To do this I am using flextable. When I use ...
0
votes
1answer
26 views

Suppress output, keep pander and plot in R markdown

I have the following code in my Rmd file: library(randomForestSRC) library(ggRandomForests) rf_all <- rfsrc(Y ~ ., data=df, block.size=1, ntree=100, importance=TRUE) plot(gg_vimp(vimp.rfsrc(rf_all)...
1
vote
0answers
22 views

How to add more information in the title page of beamer presentation in R markdown?

I tried like this method, title: "Course" author: | | %email: | %office output: beamer_presentation But, it will show all the information of block "author" in ...
0
votes
1answer
44 views

Unable to create table using ggplot() in Rmarkdown for word

I am trying to create a table like the following image: I want this table to be created from rmarkdown to a word file. I have tried to create it using knitr. But it is not being created. value_1 &...
0
votes
0answers
9 views

Missing blue background for chunks in Rmarkdown

I did my first little project in R Studio. We now have to submit it in Rmarkdown where I ran into an issue. I placed each number we had to work on in a seperate chunk but in the output the typical ...
0
votes
1answer
25 views

How to change the fontsize in beamer_presentation smaller?

I want to make the font size of code Chunk in R markdown smaller so that each slide can contain more content. I tried to set the font size for the total beamer, title: "In" author: "Y" output: ...
1
vote
0answers
32 views

How to generate html / pdf reports from a function within an R package

I would like to include a function in my R package that generates an html/pdf report, given some input data. For example, let’s imagine the following function: #' @title Nice Report #' @description ...
1
vote
1answer
19 views

Conditionally execute cells in Rnotebook that contain markdown and inline code chunks

I am using an R Notebook to generate a personalized report for multiple people. Each report will be based on a different subset of the same dataset. Within the report, I have a section there I talk ...
2
votes
0answers
17 views

bookdown: customize the output filename

This is a follow up to an earlier question I asked here: creating accompanying slides for bookdown project Bookdown allows compiling the file to various format, including multiple pdf. The issue is ...
0
votes
0answers
19 views

Make a graph discoverable in an R notebook

In an R notebook, is it possible to make a graph discoverable? I would like the graph to be revealed only when a user wants to see it. Imagine a situation where some readers may want to see a level ...
2
votes
1answer
41 views

How to add list of figures and list of tables to the table of content with R markdown and bookdown

I have a report (pdf output) where I want to add bibliography, list of figures and list of tables to the appendix. And I want those three elements to appear in the table of content. I add the ...
-2
votes
1answer
20 views

Why Rmarkdown shows different random numbers in pdf output than the ones in the Rmd file?

I set.seed in Rmd file to generate random numbers, but when I knit the document I get different random numbers. Here is a screen shot for the Rmd and pdf documents side by side.
1
vote
1answer
33 views

Infering the size of a minipage from the containing tikz node for rmarkdown

This is a follow-up question to Using bullets list in tikz's node label in rmarkdown. I had some TikZ code that works fine in pure LaTex but NOT when I transport it to rmarkdown where the error ! ...
0
votes
0answers
19 views

loop to create rmd section with a dynamic plotly chart

Trying to create a function or a loop that creates a new r markdown header section that contains a plotly (plot_ly), with the chart plot column linked to the section heading (i.e. column name = ...
0
votes
0answers
41 views

How to base the Output file name and sub title on user input using params

What does Work I am able to make the subtitle of my pdf file dynamic based on user input. I am also able to generate a 'semi-dynamic' file name using the subtitle field from the YAML (the working ...
0
votes
0answers
29 views

How to format table outside of code chunk?

I have a table with inline r code outside of a codechunk, like this: --- title: "test" output: html_document: theme: flatly --- ```{r} data(mtcars) ``` | Col1 | Col2 | |------ |-...
0
votes
0answers
35 views

R: replace variable name in batch

I am trying to update my variable names in the rmarkdown file, for example: apple.table = matrix(10, 12, nrow=4) apple.table[,2] = rep(0, 4) I would like to change all "apple.table" into "pear.table"...
0
votes
2answers
27 views

tikzDevice does not use LaTeX preamble when used in RMarkdown document

I want to use tikz as graphics device in RMarkdown and I want it to include the generated LaTeX preamble. In the past, I already used tikzDevice within knitr documents. The tex file generated by ...
0
votes
0answers
13 views

How to show the content of HTML using the withMathJax function in the shiny app?

I use the withMathJax(includeMarkdown("Untitled.md")) to output the html in the shiny app. However, the content of html such as # Grade 1, ## Grade 2 could not be shown in the shiny, although the html ...
1
vote
2answers
37 views

Using bullets list in tikz's node label in rmarkdown

I have a tikz code to generate some graphs that works properly in latex (tested on overleaf: https://www.overleaf.com). However, this is supposed to be part of a large rmarkdown file but I cannot seem ...
0
votes
0answers
13 views

How to use code folding in Distill for R Markdown articles?

We have code folding in RMarkdown documents, but only when the output is html_document. The answer: /a/37839683/5359328 doesn't work in Distill for R Markdown Articles since ...
0
votes
0answers
32 views

Low quality graph rendering with html_notebook (R-markdown)

I'm having an issue with the low-quality graph output when saving html_notebook in R markdown. I tried changing the dpi and fig.retina settings of the chunks but didn't see an impact. This only ...
0
votes
0answers
33 views

Trailing period after section number in Rmd notebook

I have an R notebook like the following: --- title: "R Notebook" output: html_notebook: number_sections: true toc: true --- # First section ## Subsection Some text # Second section ...
0
votes
1answer
35 views

How to not execute certain Rmarkdown chunks based on a parameter?

This is related to an existing post. Since I'm a beginner and cannot add comment, I'm asking a question and hope someone can link this to the relevant post. I want to not execute certain chunks ...
3
votes
1answer
59 views

In RStudio, `knit` always works, but `rmarkdown::render` fails on second run (but not first!)

I'm trying to do something quite simple: generate reports in PDF format. Finally found a way that reproduces my issue. I need to use rmarkdown::render to create reports based on data in GlobalEnv. I ...
0
votes
0answers
15 views

Replacing variable without quotes in R Markdown SQL Chunk

I am using a sql chunk chunk and using ?parameter in my query to substitute variables like: ```{sql} Select * from some_table where some_column = ?parameter ``` However, I want to be able to use ...
0
votes
0answers
23 views

Download PDF icon in bookdown

I have a document I'm writing with bookdown. This document will only have a HTML version. However, I want to make a PDF file available for readers to download. I would like to make it available ...
0
votes
0answers
12 views

Export RMarkdown generated PDF through Shiny

How to Generate the Word file in the same way what i have generated the PDF file from ShinyApp? I have tried different argument types in rmarkdown:render function as mentioned below to get the same. ...
0
votes
0answers
17 views

How to translate captions for tables and figures in Markdown to captions in Word

With the R package "captioner" you can automatically make captions for tables and numbers. I'm using it to label my tables in Markdown and want to knit my Markdown-files into Word-Files. However, in ...
0
votes
0answers
19 views

How to make Rmarkdown with output word-document interpret CSS code?

I need to put text around a shape. I can do it if the output is in html, with a CSS code. But my output has to be word and then Rmarkdown ignores the CSS snippet. How do I make Rmarkdown with output ...
1
vote
1answer
14 views

Change Default Beamer slide size

In R markdown when using Beamer slides if you try to plot you need to specify the plot sizes (unlike in the reports) so that the plots fit on a page. This can often result in the plots appearing to be ...
0
votes
0answers
13 views

Can't load data when knitting / knit_engines$set()

I want to knit my R-Markdown file. It is compiling and I get my output HTML file. Yet The data I want to load from local csv files is not loaded. When I want to access the datasets in my Red file I ...
0
votes
0answers
32 views

Problem with knit to html in pandoc and RGL

I'm trying to export my code with the rmarkdown to html. I'm work with geometric morphometrics analysis with geomorph package. Among my plots, I have some 3D models that are plotted with the RGL. The ...
0
votes
0answers
58 views

How to use Rmarkdown to write academic paper based on LaTeX Template

How to use R markdown to write academic paper based on the LaTeX template not available in R studio R markdown template. I want use R Markdown to write academic paper based on the LaTeX template for ...
1
vote
1answer
37 views

converting call to equation in r markdown

I have written the ggstatsplot package to carry out some statistical analysis. The package functions (in the development version) can either return a plot or a call that contains statistical details ...
1
vote
0answers
17 views

rticles: How to have citations not processed by pandoc

When using the rticles package, citations are already processed in the .tex file. For example: In the template for the Elsevier article there is this line: Here are two sample references: @...
0
votes
1answer
34 views

How to access data stored in server.R from outside the server/UI

I am pretty new to R/Rshiny/RMarkdown and I have taken some basic userinput templates to build an app. What I want is for the user to input a filepath and to be able to call the filename and filepath ...
1
vote
1answer
36 views

How to speed up bookdown generation?

I'm currently working on a book using bookdown. It uses some code snippets which take time to compile, execute and get output. I use the following commands to build HTML, PDF and EPUB files for the ...
0
votes
0answers
32 views

Plotly image is cropped when embedding it with R Markdown

I've got the following problem, driving me crazy these days... 1) I'm building a Slide presentation with R Markdown / reveal.js / knitr --- output: revealjs::revealjs_presentation: pandoc_args:...
0
votes
0answers
27 views

R-markdown error - cannot generate html file

I'm running R-markdown with command lines: Rscript -e "rmarkdown::render('BRS_totalRNA.Rmd',output_file='BRS_totalRNA.html')" my code worked fine until the last step, which is to generate the html ...
0
votes
1answer
33 views

How to add image underneath title on title page?

I am writing a data analysis report. On my cover page I want to insert an image underneath the title and above the author in the blank space. My code is shown below. --- title: \vspace{1in}"...
0
votes
0answers
18 views

Adding caption to figure in Rmarkdown using formula

I want caption on every figure in my Rmarkdown document. This caption should be based on a formula which will show total number of observations in the source data. I am using nrow(data) to calculate ...