r-markdown

Rmarkdown removes citation hyperlink

微笑、不失礼 提交于 2019-12-01 17:29:15
问题 when using Rmarkdown to build a pdf with citations included, it removes the hyperlinks of the citations by default. Looking at the latex file produced, I can see \usepackage{hyperref} in the pre-amble, but the citations look as follows: rmd input: @sharpe latex output: sharpe (1999) Thus it produces a non-dynamic citation in pdf. The latex output that I would expect is: \citet{sharpe}, which produces hyperlinked citation in pdf. Any ideas why it writes out my bibtex inputs like this and how I

How to make vertical scrollbar appear in RMarkdown code chunks (html view)

北战南征 提交于 2019-12-01 17:19:35
I've found many examples outlining how to add horizontal scrollbars to R Markdown HTML output, including this specific example here . However, none that describe how to add vertical scrollbars. Again borrowing from the linked example, but transposing a wide matrix to a "tall" matrix, I'd like to scroll vertically through the matrix in my ioslide presentation. --- title: "Vertical needs" author: "Hyped" date: "December 13, 2016" output: ioslides_presentation --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) ``` ## Where's my vertical scrollbar? ```{r} x <- matrix(nrow = 40,

Printing ggplot figures side by side in R markdown HTML file?

女生的网名这么多〃 提交于 2019-12-01 17:06:49
问题 I'm printing two plots with ggplot into an R Markdown HTML output, but I'd like them to appear side by side. Is this possible? Could I set the size of the figures as well? SO far I can only print them one after the other. I also tried the multiplot function from the R Cookbook, but that severely distorts the plots... Thanks! title: "HT Chip MiSeq/HiSeq Analysis" date: "October 1, 2015" output: html_document: highlight: haddock theme: flatly --- ```{r plots, echo=FALSE} genesDetectedDensity

Rmarkdown/Bookdown: Separate figure numbering for Supplemental Section

a 夏天 提交于 2019-12-01 16:50:47
Certain kinds of documents, such as journal articles, often have a Supplemental Section, where the numbering of figures is different from the main body. For example, in the main body, you might have Fig 1-5. But then, for the Supplemental section, the numbering restarts as Fig S1, S2, S3, etc. Bookdown allows cross-referencing ( \@ref(fig:label) but I'm not sure how to restart the numbering in a separate section. Is there a good way to do this? lukeholman You can define a new LaTeX function in the YAML header of your .rmd file as follows: \newcommand{\beginsupplement}{ \setcounter{table}{0}

Can't use Rcpp engine in R Markdown

大憨熊 提交于 2019-12-01 16:50:38
I tried to Knit HTML the following Rmd file: --- title: "Untitled" author: "Florian Privé" date: "12 septembre 2016" output: html_document --- ```{r fibCpp, engine='Rcpp'} #include <Rcpp.h> // [[Rcpp::export]] int fibonacci(const int x) { if (x == 0 || x == 1) return(x); return (fibonacci(x - 1)) + fibonacci(x - 2); } ``` I got the following error: Building shared library for Rcpp code chunk... Warning message: l'exécution de la commande 'make -f "C:/PROGRA~1/R/R-33~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB

Rmarkdown not outputting results of system command to html file

怎甘沉沦 提交于 2019-12-01 16:43:30
问题 I'm new to using Markdown, and have looked for a similar problem to this on SO without success. I'm using Rmarkdown (with Rstudio and knitr) to write a vignette that describes reading in a datafile which is imported as part of the package. I can correctly access the datafile using > system.file("extdata", "Marlin-tag38606.txt", package = "xtractomatic") I want to show the first few lines of this file in the vignette, so my code reads ```{r, results=as.is} datafile <- system.file("extdata",

R bookdown - custom title page

匆匆过客 提交于 2019-12-01 16:27:20
问题 How to customize title page using bookdown? I tried using the following code in the YAML header. includes: in_header: preamble.tex before_body: body.tex The body.tex file was something pretty simple, just for test: \begin{titlepage} Hello world \end{titlepage} 回答1: In the LaTeX template <R-Library>/rmarkdown/rmd/latex/default-1.17.0.2.tex we see \begin{document} $if(title)$ \maketitle $endif$ $if(abstract)$ \begin{abstract} $abstract$ \end{abstract} $endif$ $for(include-before)$ $include

Text Justification in Rmarkdown word document

∥☆過路亽.° 提交于 2019-12-01 15:54:52
When I create the word document in Rmarkdown, text is always left-aligned: Is it possible (and how) to justify the text in Rmarkdown? michael A template (i.e., like a custom style sheet) can be created in Word (or LibreOffice / OpenOffice), containing whatever page formatting and document styles you wish, and referenced from the rmarkdown file, i.e., --- title: "My Document" output: word_document: reference_docx: mystyles.docx --- ...rest of your rmarkdown here... See: https://vimeo.com/110804387 http://rmarkdown.rstudio.com/word_document_format.html http://rmarkdown.rstudio.com/articles_docx

Rmarkdown/Bookdown: Separate figure numbering for Supplemental Section

回眸只為那壹抹淺笑 提交于 2019-12-01 15:52:52
问题 Certain kinds of documents, such as journal articles, often have a Supplemental Section, where the numbering of figures is different from the main body. For example, in the main body, you might have Fig 1-5. But then, for the Supplemental section, the numbering restarts as Fig S1, S2, S3, etc. Bookdown allows cross-referencing ( \@ref(fig:label) but I'm not sure how to restart the numbering in a separate section. Is there a good way to do this? 回答1: You can define a new LaTeX function in the

Text Justification in Rmarkdown word document

旧城冷巷雨未停 提交于 2019-12-01 15:33:13
问题 When I create the word document in Rmarkdown, text is always left-aligned: Is it possible (and how) to justify the text in Rmarkdown? 回答1: A template (i.e., like a custom style sheet) can be created in Word (or LibreOffice / OpenOffice), containing whatever page formatting and document styles you wish, and referenced from the rmarkdown file, i.e., --- title: "My Document" output: word_document: reference_docx: mystyles.docx --- ...rest of your rmarkdown here... See: https://vimeo.com