r-markdown

Split title in two lines in Rmarkdown for word output

*爱你&永不变心* 提交于 2020-01-03 17:47:06
问题 I have seen various solutions around which work for pdf and HTML document output. However, none worked for me for word output. When used | as suggested here: Split the title onto multiple lines? simply made the whole title disappear. Here is the code: --- title: | | Supporting Information | Development and mechanistic bla bla. author: Some people output: word_document: reference_docx: ACS SI style for RMD.docx mainfont: Arial --- <style> body { text-align: justify} p {line-height: 1.5em;} <

Using knit2pdf with Rmd files

梦想的初衷 提交于 2020-01-03 08:18:29
问题 Is it possible to use the knitr function knit2pdf() directly with R Markdown (Rmd) files? I've seen various tutorials/class notes that seem to suggest it can e.g. here and here (Ctrl+F "knit2pdf" in either). But when I take a simple rmd file (saved as "test.rmd") --- title: "knit2pdf test" author: "A Aaronson" date: "Thursday, February 19, 2015" output: pdf_document --- This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For

A workflow with bookdown to produce frequency, cross tables and model summary tables

无人久伴 提交于 2020-01-03 03:32:10
问题 I am starting to write a book using bookdown and trying to find the best workflow. First of all I am trying to make frequency tables, crosstables and model summaries, using bookdown with pdf format mainly, but I am pretty sure my advisor will love I send word documents for revision, so also getting a word output would be awesome. Word output can be achieved producing first the .html file and then opening with Word. So .html and .pdf output at the same time are desiderables. Tables are the

Make html table columns wider / prevent words from wrapping in RMarkdown

拥有回忆 提交于 2020-01-03 01:22:47
问题 I'm creating an html document with R markdown which has some tables. In situations where one column of a table has character values, how can I ensure the column is wide enough to contain the entire character string without wrapping? I tried using kableExtra below, but it seems like the width argument of column_spec is not being used even though the bold argument is. library(data.table) csd <- fread(' Oct-17 Sep-17 Aug-17 Jul-17 Jun-17 May-17 Apr-17 Mar-17 Feb-17 Jan-17 Dec-16 Nov-16 Oct-16

Cache SQL chunk with R Markdown / Notebook without Knitting in RStudio

▼魔方 西西 提交于 2020-01-02 19:13:13
问题 I have a chunk of SQL in my R Markdown / Notebook Document: ```{sql output.var = "df"} SELECT * FROM FakeData WHERE Date >= '2017-01-01 ``` It takes literally 5 minutes to run. Is there an easy way to cache the result of the query without Knitting the document or writing the file to a CSV. I'd perhaps like the cache to live for a couple of hours, or maybe a day (is there a way to adjust this as well?) 回答1: If you put cache=TRUE in the chunk options and you are working in rStudio, you can

R: Removing the “Chapter” part from the title in bookdown::pdf_book with documentclass: report

折月煮酒 提交于 2020-01-02 07:46:30
问题 consider my header and first section --- title: "asdf" author: "asdf" date: "13 Januar 2018" documentclass: report output: bookdown::pdf_book: citation_package: biblatex latex_engine: pdflatex number_sections: yes fig_caption: yes --- # Introduction Here begins my introduction I want to remove the automatic "Chapter 1" part, thats sits in front of the actual chapter title (in this case Introduction ) This does not work header-includes: \renewcommand{\chaptername}{} Also using another

R: Removing the “Chapter” part from the title in bookdown::pdf_book with documentclass: report

不羁岁月 提交于 2020-01-02 07:46:22
问题 consider my header and first section --- title: "asdf" author: "asdf" date: "13 Januar 2018" documentclass: report output: bookdown::pdf_book: citation_package: biblatex latex_engine: pdflatex number_sections: yes fig_caption: yes --- # Introduction Here begins my introduction I want to remove the automatic "Chapter 1" part, thats sits in front of the actual chapter title (in this case Introduction ) This does not work header-includes: \renewcommand{\chaptername}{} Also using another

How to include DiagrammeR/mermaid flowchart in a Rmarkdown file

风格不统一 提交于 2020-01-02 07:24:40
问题 I have an R markdown file: --- title: "Untitled" author: "Me" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown This is an R Markdown document. As well as a DiagrammeR/mermaid chart: graph LR A-->B How can I add the chart in the R-markdown? 回答1: Actually it is trivial: title: "Untitled" author: "Me" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown This is an R Markdown document.

Bookdown: Single html output file

杀马特。学长 韩版系。学妹 提交于 2020-01-02 04:49:15
问题 If I add a line below the first in _output.yml : bookdown::gitbook: split_by: none css: ... in the bookdown-demo the output becomes a single .html file which looks kind of plain ugly. Is it somehow possible to retain the nice style which is produced by the default settings but in a single file? If I want to send the book to someone else sending a stack of files is not great, especially if the person who receives it is not familiar with HTML as a document format. 回答1: This turns out to be a

Some Unicode characters not displayed in RMarkdown PDF output

China☆狼群 提交于 2020-01-02 04:29:04
问题 I'm trying to put together some course notes as a PDF, and am having trouble getting certain Unicode characters to display properly. Using the xelatex latex engine is necessary for the document to be rendered at all (using the default engine results in an error due to the unrecognized characters), however, only the first Unicode character (uppercase delta) is displayed properly. For example, when using the rmarkdown render() function to render the following .Rmd file: --- output: pdf_document