r-markdown

Germany quotation marks broken in tinytex/rmarkdown - even when using package `csquotes`

不打扰是莪最后的温柔 提交于 2021-02-05 06:05:34
问题 What I want: I'd like to have German quotation marks in my TeX-PDF via rmarkdown and tinytex on MacOS (Catalina). See for example: The problem: It used to work following the guidelines as proposed here. But now, it stopped working. I only get English quotation marks, but not German ones: What I tried, without success : I updated my R packages I updated TeX packages I checked that the TeX package "csquotes" is installed I changed the language from "de" to "de-De" R-Code : --- title: "German

pandoc and rmarkdown: Can't fetch an image one level above a rmarkdown document

本小妞迷上赌 提交于 2021-02-05 04:58:16
问题 I am just starting to use rmarkdown, pandoc and knitr. I am having a great deal of difficult trying to get pandoc to fetch an image that is one level above an rmarkdown document. For example, consider our project directory is ~/test, the following rmarkdown is located at ~/test/scripts: --- title: "test" --- ```{r global_options, include=FALSE} library('knitr') opts_knit$set(root.dir = '~/test') ``` ![test](figures/test.svg) I then run the command Rscript -e "rmarkdown::render('scripts/test

Pandoc #4317 forces content under title slides to be included in a frame in pandoc > 2.7

孤者浪人 提交于 2021-02-04 16:24:27
问题 In this question I explained my goal: creating accompanying slides for a bookdown project. I chose the Beamer format for the slides and was happy. However, upgrading to Pandoc 2.7 onwards (>2.6) caused my project to produce undesired slides. Specifically, any previously ignored content is now thrown into an ad-hoc slide! I find this behavior quite odd, as my understanding was that choosing slide_level: 3 meant ### was needed to create a slide! After insane amount of hours, I found what caused

Compact table in html document rmarkdown with kableExtra?

偶尔善良 提交于 2021-01-29 20:17:22
问题 I'm trying to make a 'compact' table in an RMarkdown I've tried a few things, mostly variations on setting a custom css class and providing the custom css class to a code chunk I've tried a lot of variations, all of which I can see flow through to the source code (accessed via knitting the html document, opening in chrome, and cmd + opt + u to view source and inspecting the source) However, I can't work out what's necessary to simply make rows thinner (I believe that's simply reducing cell

Blogdown serve_site() removes absolute image paths for Twitter cards

旧城冷巷雨未停 提交于 2021-01-29 14:38:39
问题 Based on this question, it's clear that Twitter requires absolute paths for card images. With that in mind, I've set baseurl = "https://strimas.com/" in my config.toml file for the Hugo Academic theme. When I build the entire site with build_site() , everything works as desired, the twitter:image metatag contains the full path to the image, and the card renders properly. However, when I use serve_site() to only re-build changed posts, it breaks everything, the image URLs go back to relative,

Zoom function in rmarkdown html plot

此生再无相见时 提交于 2021-01-29 14:27:39
问题 Is there a way, like in this SO question here, to add zooming functionality to html_documents created with rmarkdown? I work in Rstudio. I have tried the following, but of course, it does not work: --- title: Zoom in on Plots author: "MS" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) ``` <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <style> .zoomDiv { opacity: 0; position:absolute; top: 50%; left: 50%; z

Bookdown does not render image in output pdf

牧云@^-^@ 提交于 2021-01-29 14:09:43
问题 I'm trying to include an image in the example index.rmd file that comes with the bookdown-package within RStudio. (New Project -> Book Project using bookdown) I then simply appended the following code within an R code-chunk. ```{r} knitr::include_graphics("png_logo.png") ``` Running the code chunk on its own produces the expected output (shows figure). However, if I use the following command in the terminal: bookdown::render_book("index.Rmd", "bookdown::pdf_book") a pdf-file is produced, that

Download data underlying plotly graph in R

我的梦境 提交于 2021-01-29 11:16:28
问题 I am using plotly in Rmarkdown. When I plot a graph, id there a way to download the underlying data ? library(plotly) x <- c(1:100) random_y <- rnorm(100, mean = 0) data <- data.frame(x, random_y) p <- plot_ly(data, x = ~x, y = ~random_y, type = 'scatter', mode = 'lines') Typically in the plot above I would like to get the data data.frame in some csv format 回答1: You can embed the CSV file into your Rmarkdown HTML using this function: yihui.name/en/2018/07/embed-file. 来源: https://stackoverflow

rmarkdown::render prompts error while “knit to html” button runs

雨燕双飞 提交于 2021-01-29 10:39:33
问题 I got difference in output using "Knit to HTML" button and rmarkdown::render() which I figured out was related to environment. I'd like to know what exactly is the difference in environment so that I can fully understand what has happened. Here was my observation: var1 <- "" var1 <<- some code that creates a new value With the above setting, the resulting observations are listed below. (The var needs to be pushed to global for a subsequent function to work. I know it's not a good practice,

How to display plot images in Rmarkdown through a for loop?

依然范特西╮ 提交于 2021-01-29 09:44:03
问题 I am handling a list of svg to print to a html document. I am using the magick package thought I am open to using other packages/solutions. The below code is my attempt to render my html document. However, instead of rendering the svg to the html file, it simply prints the metadeta into the document. Is there a way to overcome this behavior? --- title: "My Test Report" author: "Nicholas Hayden" date: "6/12/2018" output: html_document --- ```{r setup, set-options, include=FALSE, warning=FALSE}