r-markdown

Synchronizing two leaflet maps in R / Rmarkdown

北城以北 提交于 2019-12-05 02:11:27
问题 JS leaflet allows two maps to be synchronized. See an example of synchronized leaflet maps here. I would like to implement synchronized leaflet maps in R and more specifially in Rmarkdown/knitr . Preferably, the maps should shown next to each other horizontally (just like in the example). Here is a minimal Rmarkdown ( .Rmd ) example of two maps I would like to sync. The solution does not have to be based on the the mapview package. Any solution is welcome really (-: --- title: "How to sync 2

How to get a second bibliography?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 01:47:29
In rmarkdown PDF and HTML I want two bibliographies —one for papers/books, and one for software I have used in my research. I found this related issue but it doesn't answer my question since it's concerning the combination of two *.bib files into one bibliography. I'm used to place my bibliography with <div id="refs"></div> as explained here . Possibly a second one can be placed similarly with <div id="refs_2"></div> , but I couldn't figure out how to do it since this "refs" seems not to be defined anywhere. I usually define the software in the YAML header like this nocite: | @xie_knitr:_2018,

How to best generate multiple HTML files from RMarkdown based on one dataset?

試著忘記壹切 提交于 2019-12-05 01:39:20
问题 I have an RMarkdown report that is very useful and has grown to be several pages long with all the figures and tables in the HTML file. It uses the same dataset for all the figures and tables. What I would like to do is to keep generating this large html file and then several new subdirectories, each with their own html files and subdirectories within those, each with their own html files. In this case, the full report contains data on a department, then each subdirectory would contain an

How to use RStudio to write a RMarkdown file with Stata commands?

一曲冷凌霜 提交于 2019-12-05 01:34:13
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 4 years ago . My problem is explained in the title. I've tried compiling a sample .Rmd I found here: http://www.ssc.wisc.edu/~hemken/Stataworkshops/Stata%20and%20R%20Markdown/ in addition to looking up various resources online to no avail. While my resource, Doug, was able to compile an RMarkdown, I am getting an error for the MWE below. The MWE is: --- title: "Stata and R Markdown (Windows)

Convert RStudio presentation (.Rpres) to rmarkdown presentation (.Rmd)

偶尔善良 提交于 2019-12-05 01:27:21
Currently there seem to be two ways to do presentations in R: RStudio presentations , with .Rpres extension rmarkdown , with .Rmd extension To me, it looks like the latter is slightly more powerful. The input format is very similar, yet not identical. I'm thinking about converting an RStudio presentation to rmarkdown. What's the best way to do this? How about the conversion back? On that note, I'd really like to see an "in-pane" preview for rmarkdown presentations in RStudio, just like for RStudio presentations. I wonder why this isn't implemented -- the preview forcibly shows up in a modal

Programmatically insert header and plot in same code chunk with R markdown using results='asis'

风流意气都作罢 提交于 2019-12-05 00:58:49
The results = 'asis' chunk option within Rmarkdown allows one to easily dynamically create text including headers. However, I wish to dynamically create a header with the asis option, but then in the same code chunk insert some graphics. The most related answer I could find for this is here: Programmatically insert text, headers and lists with R markdown , but the answer to this question does not allow both dynamic headers and plots within those dynamic headers. Here is a simple reproducible example follows demonstrating what I can and cannot achieve with results = 'asis' The code directly

multi-line equation in RMarkdown

感情迁移 提交于 2019-12-05 00:56:20
I am trying to create a multi-line equation in RMarkdown. I have tried the following code, extracted from http://www.rstudio.com/ide/docs/authoring/using_markdown_equations , $$ \begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x- y - xz \end{aligned} $$ however the knitred HTML document gives a single-line equation: This code produced 2 HTML lines, as desired, when cut and paste into RStudio in Windows 7 with knitr. If the second slash at the end of the 3rd line was removed, it produced the result shown in example. 来源: https://stackoverflow.com/questions/21126776/multi-line-equation

YouTube Video in R markdown

拜拜、爱过 提交于 2019-12-05 00:42:56
Is it possible to embed a YouTube video in a R Markdown? So far what I have is <a href="http://www.youtube.com/watch?feature=player_embedded&v=Q8rakpF7duU " target="_blank"><img src="http://img.youtube.com/vi/Q8rakpF7duU/0.jpg" alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a> but it only adds an image. Clicking on this image takes me to my browser where the video starts playing. Is there a way that allows me to play the video in the markdown document itself? References: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#videos You will need to use iframe. For

How to make scrollable slides in an ioslides presentation with rmarkdown

两盒软妹~` 提交于 2019-12-05 00:15:44
I am using RMarkdown to create an ioslide presentation with shiny. Some of my slides do not actually fit on one page and are truncated. Since this is a HTML output, I would like to add a scroll bar to make my long slides scrollable. I have been googling a lot and found a partial solution to make R code chunks scrollable . However I want to make my slides scrollable regardless of the content. This is a toy Rmd example giving slides not fitting on one page: --- title: "Untitled" date: "30 October 2018" output: ioslides_presentation runtime: shiny --- ```{r setup, include=FALSE} knitr::opts_chunk

How can I fix column breaks in an Rmarkdown / ioslides presentation

纵然是瞬间 提交于 2019-12-05 00:00:45
Using what is currently the development version of RStudio (0.98.758), I'm loving that I can author an ioslides presentation in rmarkdown . The rmarkdown docs for this format give a description of how to do a two-column slide, and it comes with the warning that: Note that content will flow across the columns so if you want to have an image on one side and text on the other you should make sure that the image has sufficient height to force the text to the other side of the slide. But I can't seem to possibly make an image big enough! Text still gets pushed off the bottom of the first column. In