I'm unable to load images for my RMarkdown when I use runtime:shiny
Here is a small example, without "runtime:shiny" it's working fine, but if I uncomment this line, it doesn't work:
---
title: "Untitled"
output:
html_document:
#runtime: shiny
---
```{r }
knitr::include_graphics("D:/Maths/pic.png")```
Related
I have a RMarkdown document that I'm rendering as a word document using a template as reference.
This is the code:
---
output:
word_document:
pandoc_args: [
"--reference-doc=template_report.docx"
]
always_allow_html: no
---
#Report starts here
```{r setup, include=FALSE, warning=FALSE}
library(pander)
library(rmarkdown)
library(webshot)
#Some code
```
The issue is that the word document has the same metadata printed in the report which I don't want.
output:
word_document:
pandoc_args: [
“–reference-doc=template_exec_report.docx”
]
always_allow_html: yes
Report starts here
Is there a way to remove this?
Could this because of change in R-versions. We recently moved to RStudio cloud environment and there might be a change in R-version.
Edit: This is occurring this in R 4.0.5. It is working fine in R 3.5.0
Unfortunately, I fail to knit an *.Rmd file in RStudio to PDF that includes fontawesome-icons. However, when knitting to output: html_document in renders perfectly.
Info:
I am using R version 4.0.3 with RStudio 1.3.1056
I have installed the latest TeX Live distribution
The following example contains elements taken from RStudio's Github:
Icon renders in HTML:
---
title: "FontAwesome in R Markdown"
output: html_document
---
```{r load_packages, message=FALSE, warning=FALSE, include=FALSE}
library(fontawesome)
```
This is an R icon: `r fa("r-project", fill = "steelblue")`.
Icon is ignored for PDF output:
---
title: "FontAwesome in R Markdown"
output: pdf_document
---
```{r load_packages, message=FALSE, warning=FALSE, include=FALSE}
library(fontawesome)
```
This is an R icon: `r fa("r-project", fill = "steelblue")`.
Neither R nor Rmarkdown shows any errors when rendering to PDF. Does anyone have an idea why it does not work?
Thank you very much.
Cheers,
Christian
You can workaround the problem by using the fontawesome5 latex package:
---
title: "FontAwesome in R Markdown"
output:
pdf_document:
keep_tex: true
header-includes:
- \usepackage{fontawesome5}
---
This is an R icon: \faRProject
The documentation of the new learnr-package states that
it’s also possible to add other forms of interactivity using Shiny (e.g. for teaching a statistical concept interactively).
I tried it with the provided example but I could not manage it. The slider does appear but not the plot. I used:
---
title: "Tutorial"
output:
learnr::tutorial:
progressive: true
allow_skip: true
runtime: shiny_prerendered
tutorial:
version: 0.1
---
```{r setup, include=FALSE}
library(learnr)
library(checkr)
library(shiny)
knitr::opts_chunk$set(exercise.checker = checkr::checkr_tutor)
```
The example did work with
---
title: "R Notebook"
output: html_notebook
runtime: shiny
---
I tracked the problem down: It was completely my own fault. I used the same name for the input variable in another R chunk with shiny code.
I did not get any error message, the output just did not show up.
The following table in rmd file turns out fine when runtime: shiny is omitted.
---
title: "Test"
runtime: shiny
output:
html_document:
toc: true
---
```{r}
require(DT)
datatable(data.frame(test=c("テスト")))
```
I am trying to convert a .Rmd file to .md (output: md_document), but the title does not show up on the rendered file.
The title does show up when I try to render the same file as an .html file (output: html_document).
Title shows up on rendered document:
---
title: "Test"
output: html_document
---
```{r}
head(cars)
```
Title does not show up on rendered document:
---
title: "Test"
output: md_document
---
```{r}
head(cars)
```
rmarkdown::render(my_file)
Any ideas why?
I am using RStudio 0.98.1091 and R 3.1.2 on a Mac 10.9.5.
The code in between -- gets interpreted, as my references are rendered with the following piece of code:
---
title: "Test"
output: md_document
bibliography: ~/mybib.bib
---
This is a test where I cite [#post1, #post2]
The interesting thing is that when I ask for both the html and md files to be generated, the title shows up on the .md file:
---
title: "Test"
output:
html_document:
keep_md: yes
---
Shouldn't the output of keep_md: yes be the same as output: md_document?
Markdown does not have such a concept as "title". HTML has the <title> tag (and Pandoc also puts the title in <h1> for the HTML output from Markdown so you can see it from the HTML body), and LaTeX has the \title{} command. It is not unexpected to me that the YAML metadata (including the title info) is not reflected in the Markdown output.