knitr

Embeding shiny app in pdf latex (R knitr)

纵饮孤独 提交于 2019-12-11 08:42:51
问题 I know that it's impossible to put shiny app in pdf latex directly, but I've heard (How to embed an interactive shiny plot in a pdf / presentation? (via knitR maybe) HubertL's answer) it's possible to bind it via link. Can someone help me with that? I haven't found anything about this. I'm using beamer Madrid (Idk if it's important). 回答1: You have to publish the Shiny app first. Once you have got the URL to the online app, you can use knitr::include_url() to include an automatic screenshot of

RStudio knit button is not showing options - continued

雨燕双飞 提交于 2019-12-11 08:38:46
问题 The question has been already asked (and answered) in 2017 RStudio knit button is not showing options and in 2014 Rstudio knit to PDF. Three cases are considered: a) You are not running R 3.0 (which is required for RMarkdown v2); b) You have a custom markdown renderer getOption(“rstudio.markdownToHTML”) c) output: pdf_document in YAML header Option c) has worked time ago but it has no effect now. Option a) I am using "R version 3.5.1 (2018-07-02)" >> version 3.0 Option b) > getOption("rstudio

How to specify table stripe colors for knitr::kable?

二次信任 提交于 2019-12-11 08:13:50
问题 How was this person able to make the tables shown in this link? It doesn't look like they were passing any arguments to kable. Here is the example: 回答1: The styles of kable tables are controlled by CSS file. tbody can be used to change the colour of the content of the table, with thead able to change the header. As shown by Lee S, you can create an external CSS file. However, you can also include the CSS directly within the R Markdown file, as markdown accepts raw HTML and passes it through

Accent in knitr

女生的网名这么多〃 提交于 2019-12-11 07:54:41
问题 I'm using knitr to compile a PDF file. I have an issue when using accent (Portuguese) such as "é". I've found other users asking similar questions but in that case, there was an error. I was able to compile the pdf (without any error). However, in the pdf file accent words disappear. For example, "número" (number in English) appears in the pdf as "nmero". I appreciate any guidance. Thanks. Thiago. R version 2.15.3 (2013-03-01) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE

Infering the size of a minipage from the containing tikz node for rmarkdown

纵然是瞬间 提交于 2019-12-11 07:46:57
问题 This is a follow-up question to Using bullets list in tikz's node label in rmarkdown. I had some TikZ code that works fine in pure LaTex but NOT when I transport it to rmarkdown where the error ! LaTeX Error: Something's wrong--perhaps a missing \item. is raised. This was solved in the answer to Using bullets list in tikz's node label in rmarkdown but another issue arises applying the solution I got in there. You can refer to the original question (Using bullets list in tikz's node label in

Error adding images and plots in ioslides_presentation w/ Runtime: shiny on Windows

断了今生、忘了曾经 提交于 2019-12-11 07:28:45
问题 When I run the following ioslides_presentation w/ runtime: shiny at work (Windows 7 Enterprise) --- title: "Untitled" author: "Me" date: "Thursday, February 05, 2015" output: ioslides_presentation: logo: images/rstudio-ball.png runtime: shiny --- ## Slide with Plot ```{r, echo=FALSE} plot(cars) ``` I get an "invalid back reference" error when attempting to include a logo or plot into the presentation . However, if I remove runtime: shiny the presentation compiles as expected, with both the

R Markdown, output test results (htest) when chunk option results=“asis”

烈酒焚心 提交于 2019-12-11 07:25:49
问题 I need to use results = "asis" for reasons stated here: https://stackoverflow.com/a/36381976/ However, using that chunk option means other outputs render non-ideally. Specifically I'm having issues outputting prop.test results, but I'm sure this would happen for other data types. I've provided 4 options in the example below, all of which fall short in some way: --- title: "R Notebook" output: html_document: df_print: paged --- ```{r, echo=F, message=F, warning=F, results="asis"} library(knitr

In R, how can we add significance stars to a kable() table?

假如想象 提交于 2019-12-11 07:18:36
问题 Using knitr::kable() function to create a .doc table through rmarkdown, how could we add "significance stars symbols" from a given data frame (df.b) (i.e. cutpoints = c(0, .001,.01,.05, .1, 1), symbols = c("^{***}","^{**}","^{*}","^{.}"," ")) near the values stored in another data frame (df.a)? knitr::kable(df.a) Would pander::add.significance.stars() work on this purpose, in a similar way as used here? Data df.a <- structure(list(X1 = structure(c(3L, 2L, 4L, 1L), .Label = c("-0.29 (-0.54 - 0

Producing pdf with knitr and Rmarkdown: accents in text show up but not in figures.

做~自己de王妃 提交于 2019-12-11 07:17:06
问题 Accents in paragraphs work perfectly. Text in figures is correct in the plot viewer, but once I compile the pdf the accents disappear from the figures. Here's an example that reproduces the issue. --- title: 'Some title' author: 'This be me' date: '`r format(Sys.Date(), "%B %Y")`' lang: es header-includes: - \usepackage{tikz} output: pdf_document: fig_caption: yes --- ```{r global options, echo = F, message=F} library(knitr) opts_chunk$set(fig.width=6, fig.height=3.5, dev = 'tikz') ``` I have

Emacs polymode gives error when opening file

蓝咒 提交于 2019-12-11 07:16:08
问题 I downloaded the polymode zip-file from GitHub, open the zip-file which gives a folder named polymode-master . I renamed the folder to polymode and put it on my .emacs.d folder. Then I inserted the following lines into my .emacs file: ;; Polymode (setq load-path (append '("~/.emacs.d/polymode/" "~/.emacs.d/polymode/modes") load-path)) (require 'poly-R) (require 'poly-markdown) When I open a file with emacs it gives me the following error: Warning (initialization): An error occurred while