r-markdown

Run RMarkdown with arguments on the command line

半城伤御伤魂 提交于 2021-02-07 05:21:19
问题 I'm trying to run a Rmarkdown file ( myfile.Rmd ) from the command line terminal. This file needs to take an argument to work. We can use this simple file as an example: --- title: "Simple example" output: pdf_document: default --- ```{r read_arg, include=FALSE} args = commandArgs(TRUE) VAR = args[1] ``` ```{r show_var} VAR ``` So, first of all, is it possible to run a Rmarkdown file by reading arguments as done for Rscripts? I mean, not by reading input files as described in this question.

Run RMarkdown with arguments on the command line

时间秒杀一切 提交于 2021-02-07 05:20:10
问题 I'm trying to run a Rmarkdown file ( myfile.Rmd ) from the command line terminal. This file needs to take an argument to work. We can use this simple file as an example: --- title: "Simple example" output: pdf_document: default --- ```{r read_arg, include=FALSE} args = commandArgs(TRUE) VAR = args[1] ``` ```{r show_var} VAR ``` So, first of all, is it possible to run a Rmarkdown file by reading arguments as done for Rscripts? I mean, not by reading input files as described in this question.

Use `rmarkdown::render` in a restricted environment

…衆ロ難τιáo~ 提交于 2021-02-06 15:52:50
问题 I have the following Rmd file I called test.Rmd : --- title: "test" output: html_document --- ```{r} print(y) ``` ```{r} x <- "don't you ignore me!" print(x) ``` I want to call render the following way: render('test.Rmd', output_format = "html_document", output_file = 'test.html', envir = list(y="hello")) but it fails: processing file: test.Rmd |................ | 25% ordinary text without R code |................................ | 50% label: unnamed-chunk-1 |.................................

Use `rmarkdown::render` in a restricted environment

冷暖自知 提交于 2021-02-06 15:52:10
问题 I have the following Rmd file I called test.Rmd : --- title: "test" output: html_document --- ```{r} print(y) ``` ```{r} x <- "don't you ignore me!" print(x) ``` I want to call render the following way: render('test.Rmd', output_format = "html_document", output_file = 'test.html', envir = list(y="hello")) but it fails: processing file: test.Rmd |................ | 25% ordinary text without R code |................................ | 50% label: unnamed-chunk-1 |.................................

how to show underscores symbol in markdown?

北战南征 提交于 2021-02-05 14:17:09
问题 in markdown, my_stock_index is my stock index. But I want it to show my_stock_index . How can do that? 回答1: You just escape it with a backslash: my\_stock\_ticker is what you type to get my_stock_ticker The syntax seems to work for all markdown parsers. However, php markdown parsers use the numeric character reference _ instead of the actual character in it's output. 回答2: The single backslash escape works fine in Jupyter unless you are in an italicized block, in which case, you want to close

how to show underscores symbol in markdown?

只愿长相守 提交于 2021-02-05 14:16:26
问题 in markdown, my_stock_index is my stock index. But I want it to show my_stock_index . How can do that? 回答1: You just escape it with a backslash: my\_stock\_ticker is what you type to get my_stock_ticker The syntax seems to work for all markdown parsers. However, php markdown parsers use the numeric character reference _ instead of the actual character in it's output. 回答2: The single backslash escape works fine in Jupyter unless you are in an italicized block, in which case, you want to close

How to include all chapters in TOC in different html pages

↘锁芯ラ 提交于 2021-02-05 10:00:13
问题 I have a rmarkdown file which I need to knitr to get an html output composed of three different pages. Each page has some chapters (1 chapter in the first, 4 in the second page and 4 in the third). I need to repeat the full TOC ( with all chapters within ) in each page. With the code I have each TOC is split and refers to chapters of the single page only. I copied following code at the beginning of each page. I am very new to this thank you so much. --- title: "page" author: "me" date: "26/02

How to include all chapters in TOC in different html pages

梦想的初衷 提交于 2021-02-05 10:00:10
问题 I have a rmarkdown file which I need to knitr to get an html output composed of three different pages. Each page has some chapters (1 chapter in the first, 4 in the second page and 4 in the third). I need to repeat the full TOC ( with all chapters within ) in each page. With the code I have each TOC is split and refers to chapters of the single page only. I copied following code at the beginning of each page. I am very new to this thank you so much. --- title: "page" author: "me" date: "26/02

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

烈酒焚心 提交于 2021-02-05 06:09:44
问题 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

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

梦想的初衷 提交于 2021-02-05 06:06:05
问题 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