r-markdown

Multiple lines in a single cell for rmarkdown table

别等时光非礼了梦想. 提交于 2019-12-12 12:38:49
问题 I would like to create a table which has multiple lines in a single cell using RMarkdown. This page mentions multiline and grid table cells (http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html). But it seems backslash is not working. A backslash followed by a newline is also a hard line break. Note: in multiline and grid table cells, this is the only way to create a hard line break, since trailing spaces in the cells are ignored. This is my example Rmd file. --- title: "Test" author:

wrap text in knitr::kable table cell using “\n”

只愿长相守 提交于 2019-12-12 12:24:22
问题 How can I wrap a cell in a knitr::kable table cell using \n ? I want to generate a .rmd file containing some tables where one column needs text wrapping. The places where the wrapping should occur are marked with \n . I tried (this is a standalone .rmd document): --- output: pdf_document --- ## A Table with text wrap ```{r cars} knitr::kable(data.frame(col1 = c("a", "b"), col2 = c("one\ntwo", "three\nfour"))) ``` ..but this doesn't work. Instead of staying in col2 , the wrapped part lives on

Incorrect conversion from R Markdown to LaTeX

懵懂的女人 提交于 2019-12-12 11:41:44
问题 Why does the following R Markdown minimal (non)-working example not compile to PDF? --- header-includes: - \usepackage{fancyhdr} - \pagestyle{fancy} - \lhead{} - \chead{} - \rhead{The performance of new graduates} - \lfoot{From: K. Grant} - \cfoot{To: Dean A. Smith} output: pdf_document: keep_tex: yes latex_engine: xelatex --- # Test In particular, the problematic conversion happens to -\lfoot{From: K. Grant} and -\cfoot{To: Dean A. Smith} , as seen in the output .tex file: \usepackage

rmarkdown html embed pdf/eps

人走茶凉 提交于 2019-12-12 11:18:07
问题 I'm trying to make an R markdown html document in Rstudio. I have a number of images that I have in pdf and eps format. I'm trying to embed these into the output with the \includegraphics{path to image} command. However, the output html doesn't show anything. 来源: https://stackoverflow.com/questions/32592984/rmarkdown-html-embed-pdf-eps

Can't use PLOS rticles template with bookdown

倾然丶 夕夏残阳落幕 提交于 2019-12-12 10:57:38
问题 Following this post, I'm trying to put @YihuiXie 's answer in practice with the PLOS template of rticles but it doesn't work. Any help would be very appreciated! Below in a minimal example: --- title: Title of submission to PLOS journal author: - name: Me affiliation: Here # output: rticles::plos_article output: bookdown::pdf_document2: base_format: rticles::plos_article --- # Introduction Some text \@ref(fig:fig1) # References {#references .unnumbered} The error message reads Error in pdf

how to render DT::datatables in a pdf using rmarkdown?

萝らか妹 提交于 2019-12-12 10:48:52
问题 How can I display DT::datatable objects from a rmarkdown script onto a pdf document? My code so far is breaks down with the following error: processing file: reportCopy.Rmd output file: reportCopy.knit.md Functions that produce HTML output found in document targeting latex output. Please change the output type of this document to HTML. Including always_allow_html: yes in the YAML header suppresses the error, but nothing appears on the pdf. I would be grateful for any help. My code is

Rstudio knit pdf in Rstudio loadNamespace(name): there is no package called 'rmarkdown'

纵然是瞬间 提交于 2019-12-12 10:47:45
问题 I just updated to Rstudio Version 0.98.1074. When I try to use compile notebook with a script or Knit pdf with an .rmd I get Error in loadNamespace error: there is no package called 'rmarkdown' yet I can type rmarkdown::render("filename.rmd") and it will render the document. I removed rmarkdown and re-installed with RStudio and it did not help. I've updated all my packages and I'm using R3.1.1. This is a minor inconvenience since I have a workaround but thought I'd post in case there is a

Is it possible to generate the RTable (FlexTable) in pdf with RMarkdown?

狂风中的少年 提交于 2019-12-12 10:10:58
问题 I am just curious that is it possible to generate the RTable (FlexTable) in pdf with RMarkdown? I can generate it in html output but it is not working for pdf output. I google this question but there is no exact answer for it. My code: ```{r, echo=FALSE, results='asis'} library(ReporteRsjars) library(ReporteRs) library(rtable) library(dplyr) vanilla.table(iris) ``` Since it can generate in word, I assume it is possible for the pdf one. I have tried cat(as.html(vanilla.table(iris))) but it is

Disable mouse click to show another slide in rmarkdown slidy_presentation

℡╲_俬逩灬. 提交于 2019-12-12 09:15:08
问题 I'm wondering how to disable left mouse click to show another slide in rmarkdown slidy_presentation. If I'm trying to disable/enable some category in plotly chart, it'll skip to another slide. Is there any option how to handle it. Many thanks for your suggestions in forward. 回答1: In my current version of slidy (rmarkdown 1.6) you can disable/enable mouse click advance by pressing key 'k' , when viewing the presentation. To change the default (on file open) behavior I had to change line 55 in

Rotate a table from R markdown in pdf

拈花ヽ惹草 提交于 2019-12-12 08:22:56
问题 I'm writing in R Markdown and have a contingency table that is quite wide. I am converting the R markdown document to a PDF using pandoc. Is it possible to rotate or shrink the table? Ideally this would be done without having to switch to LaTeX formatting. My Attempts: I've been abusing the figure options in knitr to attempt this, but whether I use kable or xtable, I haven't had any luck. Some permutations I have tried include: ```{r out.extra='angle=90', results='asis'} library(knitr) kable