r-markdown

YouTube Video in R markdown

依然范特西╮ 提交于 2019-12-22 03:36:09
问题 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:

RMarkdown: How to change headline in table of contents in R Markdown?

人走茶凉 提交于 2019-12-22 03:25:00
问题 When I'm using the toc: yes command, the document contains "Content" as the headline of the table of contents. Due to the fact that I want to write this document in german, I also want to change the headline of the table of contents to the equivalent german word. Any suggestions on how to change this? 回答1: With this YAML header that includes LaTeX-Package babel, it works for me: --- title: "TOC in German" header-includes: - \usepackage[ngerman]{babel} output: pdf_document: toc: true number

Graphing matplotlib with Python code in a R Markdown document

杀马特。学长 韩版系。学妹 提交于 2019-12-22 01:48:23
问题 Is it possible to use Python matplotlib code to draw graph in RStudio? e.g. below Python matplotlib code: import numpy as np import matplotlib.pyplot as plt n = 256 X = np.linspace(-np.pi,np.pi,n,endpoint=True) Y = np.sin(2*X) plt.plot (X, Y+1, color='blue', alpha=1.00) plt.plot (X, Y-1, color='blue', alpha=1.00) plt.show() Output graph will be: Then I need to write a R Markdown to include these code and generate graph automatically after knitting the markdown. 回答1: One possible solution is

How do I get a long (more than 1 page) bibliography to print in an R markdown beamer?

…衆ロ難τιáo~ 提交于 2019-12-22 01:31:04
问题 I have an issue rendering bibliographies covering more than one page as only the first one is printed using RMarkdown and beamer output. The same question has been posted at http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html#comment-2398115545 but without any help. --- title: "Sample Document" output: beamer_presentation bibliography: bibliography.bib --- 回答1: You can force a slide to be continued on the next one by setting its class to allowframebreaks . Just do this

R Markdown Shiny renderPlot list of plots from lapply

爷,独闯天下 提交于 2019-12-22 00:35:38
问题 I am developing an R Markdown Shiny document to: Subset a data frame to include the "date" column and some numeric data columns. The way the shiny user input is set up, you select radio buttons for the data columns to include, then hit the "Subset Data" button to create d() - NO PROBLEM:) Generate a list of plots ( plotList ), one for each numeric data column (plotted against the date column). I am using the openair package timePlot function to generate the plots, and lapply to generate the

Howto include js dependencies of DT datatable in Rmarkdown using knitr and pandoc

烂漫一生 提交于 2019-12-21 23:09:08
问题 Is there a way to compile RMarkdown documents with datatables produced by DT outside of RStudio? I'm trying to include a datatable widget in an RMarkdown document that I then want to convert to html using knitr and pandoc. This works fine with RStudio but if I try to do the same with knitr and pandoc I'm unable to get a working html file. Here is a minimal example of an Rmd file that works with RStudio but not otherwise: --- title: "Minimal DT example" --- <style type="text/css"> table, table

Howto include js dependencies of DT datatable in Rmarkdown using knitr and pandoc

和自甴很熟 提交于 2019-12-21 22:58:25
问题 Is there a way to compile RMarkdown documents with datatables produced by DT outside of RStudio? I'm trying to include a datatable widget in an RMarkdown document that I then want to convert to html using knitr and pandoc. This works fine with RStudio but if I try to do the same with knitr and pandoc I'm unable to get a working html file. Here is a minimal example of an Rmd file that works with RStudio but not otherwise: --- title: "Minimal DT example" --- <style type="text/css"> table, table

Replace the automatic numbering of captions inrmarkdown / knitr / pdf

余生颓废 提交于 2019-12-21 21:30:58
问题 I am generating a PDF document with Rmarkdown, within which I want to manually define figure numbers . Below is an example of a chunk: ```{r chunk26, fig.cap = "Fig. 5.3 My figure caption"} plot(1, 1) ``` I use a special numbering to follow the chapters of my document. The problem is that when I knit the PDF, "Figure X:" is automatically added before each caption. As a result, my figure captions look like this example: Note I have used the following parameters in the beginning of my rmarkdown

Evaluate a Chunk based on the output format of knitr

我的梦境 提交于 2019-12-21 19:01:31
问题 I am a beginner in using Markdown (I am using it with R studio and knitr). I am struggling with a point that I hope you would be able to help me to figure it out. I would like a chunk to be evaluated only if the output_format of the rmarkdown document is pdf. In other words, the chunk option "eval" automatically set to TRUE if the knitr output was selected as "knitr PDF". Otherwise, eval = FALSE. In your view, what is the most straightforward way to do this. Many thanks in advance 回答1: Try

kableExtra only works if there's another table in the presentation?

做~自己de王妃 提交于 2019-12-21 17:54:52
问题 When I use kableExtra for a PDF output, the table renders beautifully, BUT gives an error if there isn't another, non-kable extra table in the program. Has anyone else seen this behavior? the file appears to knit fine, but then throws an error in pandoc? For example, this code: --- output: beamer_presentation: fontsize: 10pt --- ```{r global_options, include=FALSE} library(rmarkdown) library(knitr) library(kableExtra) ``` ### Slide with table ```{r echo=FALSE, warning=FALSE, message=FALSE} df