r-markdown

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

时间秒杀一切 提交于 2019-12-19 06:25:21
问题 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}

Authors and affiliations in the YAML of RMarkdown

亡梦爱人 提交于 2019-12-18 21:54:59
问题 I know this question was already asked in the past in this forum (1, 2, 3). Before you mark this as duplicated, I tried all the answers with no success. Most of the questions were asked long ago, and some updates related with pandoc might affect nowadays results. The issue is that I am writing a scientific paper using RMarkdown, and would like to export the results either in HTML, PDF or Word files. More importantly is that there are 12 authors signing the papers. Some of the authors present

Looping through code in knitr and rmarkdown

。_饼干妹妹 提交于 2019-12-18 18:20:35
问题 I have been putting together reports using Knitr and rmarkdown. I love being able to output my R code in a reproducible R format, however I am continuously running into a limitation and am wondering who has tackled this before. I need to loop through say two pages with various content and knitr settings for each collection of data in a list. Once the code for those two pages is written I would like to fill in i for each collection in a list (1, 2, 3, 4, 5, etc). For the example below I have

How to extract the content of SQL-Files using R?

流过昼夜 提交于 2019-12-18 17:29:21
问题 I have of folder/directory of one of my colleagues full of sql statements. The folder is updated by him daily as well. I would like to document these sql statements for futures colleagues. However, I'm looking for a way to "automate" that process. I thought about to use crontab once a week and run a R-Markdown file which automatically update the existing R-Markdown file. My approach is as follows: path = "c:/SQL_files/" out.file<-"" file.names <- dir(path, pattern =".sql") # here I changed `

Captions on tables in pdf documents generated by rmarkdown

a 夏天 提交于 2019-12-18 16:25:11
问题 How can I get captions on my table floats in pdf_document generated by rmarkdown? Using output: pdf_document: fig_caption: true and ```{r, fig.cap='a caption'} myplot ``` Generates a floating figure with myplot and the caption specified. How do I achieve the same thing with tables generated by xtable? ```{r, results='asis', fig.cap='table caption'} print(xtable(table), comment = FALSE) ``` I have tried using floating.environment = 'figure' in print.xtable, but to no avail. 回答1: Or similarly,

How to make part of rmarkdown document without section numbering?

只愿长相守 提交于 2019-12-18 12:58:19
问题 I have an rmarkdown document (.Rmd) that I want to knit into a pdf document. number_sections has been put to 'yes' and toc to 'true'. How can I add appendix sections that appear in the table of contents but don't have a section number? Here is an example .Rmd code. How can I let appendix A and appendix B be numberless sections and let them appear in the table of contents at the same time? --- title: "Test" author: "test test" geometry: margin=1in output: pdf_document: keep_tex: yes latex

call RMarkdown on command line using a.R that is passed a file

这一生的挚爱 提交于 2019-12-18 12:56:20
问题 In summary, I am using my script 'Graphs.R' on 'input_file1.txt' in RStudio to create a Rmd which I then knit to html. I would like to automate this process to run more files on the command line. So far, I can get the Rscript to run on the command line using: Rscript Graphs.R input_file1.txt I also know that I can create an .RMD file using: Rscript -e rmarkdown::render(Graphs.R) However, I would like to do the following: Rscript -e rmarkdown::render('Graphs.R input_file1.txt', 'output_file

Cross-referencing in a single-file bookdown document

依然范特西╮ 提交于 2019-12-18 12:55:30
问题 One of the promises of the bookdown package is functions for automatic numbering of figure/table captions, and cross-referencing figures/tables/sections. This is claimed to be enabled for single-Rmd bookdown, if we use bookdown::html_document2 in the YAML: https://bookdown.org/yihui/bookdown/a-single-document.html Looking at the raw rmarkdown for that chapter of the bookdown manual, I've tried to follow the instructions to make a single Rmd file that can use those cross-referencing functions.

How to change the figure caption format in bookdown

泪湿孤枕 提交于 2019-12-18 12:55:24
问题 When using bookdown (single document), figures are numbered automatically as: Figure 1 Text of figure caption. In chemistry, the convention is to label main Figures as: Figure 1. Text of figure caption. and for the supporting information document: Figure S1. Text of figure caption. Also in the figure reference in the text we need: ...as can be seen in Figure 1, ... so the reference text should not be bold. Question How can i make bookdown (or rmarkdown) produce figure and table captions like

R Markdown with Shiny Server change host parameter

北城以北 提交于 2019-12-18 12:35:13
问题 I am running RStudio on a server and I created a RMarkdown (.Rmd) file. It works fine if I create it as a static HTML but it does not work if I want it to be interactive (by adding runtime:shiny ). The issue is that when I add runtime:shiny and press the Run Document button the application will try to open at 127.0.0.1:xxxx (here xxxx is a random port). In order to make it work I would have to be able to change the host parameter to '0.0.0.0'. This is an option in the runApp function from the