r-markdown

Why does rendering a pdf from rmarkdown require closing rstudio between renders?

痴心易碎 提交于 2020-01-09 13:07:47
问题 Background I am trying to make a rmarkdown document that is rendered using render() . The render call has two elements that are parameterized: I would like the user to be able to specify pdf or html. Straightforward using output_format() . I also would like to pass a parameter to the document to specify if the tables (using the kableExtra package) are latex or html. This is the rmarkdown file called test.Rmd --- title: "Title" author: "Zzz Zzzzzz" params: table_format: value --- ```{r setup}

Why does rendering a pdf from rmarkdown require closing rstudio between renders?

谁说胖子不能爱 提交于 2020-01-09 13:07:08
问题 Background I am trying to make a rmarkdown document that is rendered using render() . The render call has two elements that are parameterized: I would like the user to be able to specify pdf or html. Straightforward using output_format() . I also would like to pass a parameter to the document to specify if the tables (using the kableExtra package) are latex or html. This is the rmarkdown file called test.Rmd --- title: "Title" author: "Zzz Zzzzzz" params: table_format: value --- ```{r setup}

How can I write special characters in RMarkdown latex documents?

人盡茶涼 提交于 2020-01-09 11:15:40
问题 I am trying ot write a paper in RMarkdown pdf. But I dont know how to use special characters like "İ, ı, ğ, ü, ö". Those characters are present in Turkish. I can easily use them in Latex using e.g. \u{g} – ğ, \c{c} – ç, \”{u} – ü, {\i} – ı, etc. Could you please tell how can I do the same in RMarkdown? And where can I find some Rmarkdown paper or book templates? 回答1: HTML codes for Turkish characters will work (example from wikipedia): --- title: "My doc" output: pdf_document --- HTML char

How can I write special characters in RMarkdown latex documents?

a 夏天 提交于 2020-01-09 11:15:25
问题 I am trying ot write a paper in RMarkdown pdf. But I dont know how to use special characters like "İ, ı, ğ, ü, ö". Those characters are present in Turkish. I can easily use them in Latex using e.g. \u{g} – ğ, \c{c} – ç, \”{u} – ü, {\i} – ı, etc. Could you please tell how can I do the same in RMarkdown? And where can I find some Rmarkdown paper or book templates? 回答1: HTML codes for Turkish characters will work (example from wikipedia): --- title: "My doc" output: pdf_document --- HTML char

R Markdown bug (?) when displaying plots in a loop with headers

丶灬走出姿态 提交于 2020-01-07 06:36:54
问题 I'm having a strange problem, that seems to be known (e.g. https://github.com/yihui/knitr/issues/408), but so far I haven't been able to find a solution. The following code in R markdown should show a title, plot, title, plot, title, plot; instead, it shows two titles, a plot, a title, 2 plots. Anything I can do to fix it so that the correct titles show up with the right plots? ```{r, fig.height=2, fig.width=3, results='asis'} for (i in 1:3){ cat('\n') cat("#This is a heading for ", i, "\n")

r - error using custom LaTeX style file to render PDF using rmarkdown

倖福魔咒の 提交于 2020-01-07 06:26:08
问题 Based off of the answser by user3143179, I created custom.sty to specify both the fonts and LaTeX packages to use to render a PDF with rmarkdown . Content of custom.sty below: % custom.sty \usepackage{sectsty} \sectionfont{\centering} \chaptertitlefont{\centering} \usepackage{xcolor} % fonts \usepackage{fontspec} \setmainfont{LiberationSerif-Regular.ttf}[ BoldFont = LiberationSerif-Bold.ttf, ItalicFont = LiberationSerif-Italic.ttf, BoldItalicFont = LiberationSerif-BoldItalic.ttf ]

knitr templating - Dynamic chunks issue

谁说胖子不能爱 提交于 2020-01-06 14:40:39
问题 The following code is a very simplified MRE for an issue I'm experiencing. I'm trying to avoid R template packages, such as brew , and only use knit_expand() to achieve my goals. The issue is twofold: generated chunks don't get parsed (this is not happening in my real code, but happens in MRE) instead of LaTeX \includegraphics , knitr (or rmarkdown , or pandoc ) generates RMarkdown syntax for inserting figures ( ![] ). In regard to the former, I have a feeling that it might be related to my

How to change Sys.setlocale, when you get Error “request to set locale … cannot be honored”

你说的曾经没有我的故事 提交于 2020-01-06 07:54:36
问题 This relates to the problem I'm trying to resolve here: Printing UTF-8 (Russian) characters in R, Rmd, knitr. I was told that this problem does not exist if native locale was en_US.UTF-8 . (My current native locale is English_Canada.1252 .) But I cannot just simply change my English_Canada.1252 to en_US.UTF-8. - When I try I get this error message: > Sys.setlocale("LC_CTYPE", "en_US.UTF-8") OS reports request to set locale to "en_US.UTF-8" cannot be honored[1] "" Any idea how to resolve it?

Why is my image embedded in .md not displayed on Github

人盡茶涼 提交于 2020-01-06 07:14:12
问题 Assume, you have have the following Rmd (see ../Christoph999/Test/blob/master/test.md --- title: "Untitled" author: "Myname" date: "5 April 2019" output: html_document: keep_md: yes number_sections: yes toc: yes toc_depth: 2 pdf_document: number_sections: yes toc: yes toc_depth: '2' --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` text ![Some text here.](../project/pics/myimage.png?raw=true){width=400px} text I pushed everything to github with pictures in /project/pics/

Rmarkdown Fatal error: creating temporary file for '-e' failed Mac sudden error

柔情痞子 提交于 2020-01-06 06:58:38
问题 I've been able to knit my markdown files fine until today, and now I'm getting the error Fatal error: creating temporary file for '-e' failed I've looked all over and there doesn't seem to be an easy fix. I've updated R and Studio, closed everything down and reopened it to no avail. My session info R version 3.6.1 (2019-07-05) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Mojave 10.14.6 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions