r-markdown

rmarkdown vector graphics for knit word

元气小坏坏 提交于 2019-12-23 07:48:20
问题 When using rmarkdown with knitr in Rstudio to knit a Microsoft Word document, the graphics generally look crappy because the usual vector graphics formats, such as PDF are not supported in Microsoft Word. Fortunately, the devEMF package in R generates the microsoft vector format EMF, and I almost have this working for my rmarkdown application. The problem is that my image is showing up way too small. How can I control the image size? I've tried the standard things below: --- title: "Plot size

Suppress running messages from RStan in Rmarkdown HTML output

时光怂恿深爱的人放手 提交于 2019-12-23 07:47:16
问题 The following are my r code. ```{r message=FALSE, warning=FALSE, cache=0,eval=TRUE, error=FALSE} stan_m1 <- rethinking::map2stan( alist( y ~ dbinom(n, p), logit(p) <- alpha + bP*P + bA*A + bV*V, alpha ~ dnorm(0, 10), bP ~ dnorm(0, 5), bA ~ dnorm(0, 5), bV ~ dnorm(0, 5) ), data = d1, chains=2 , iter=2500 , warmup=500, debug=FALSE , verbose=FALSE,refresh=-1 ) When I knit my rmarkdown file as html output, I am getting following output. Is there any way to turn off these messages? 回答1: Put

Deploy Rmarkdown web app on server

假装没事ソ 提交于 2019-12-23 05:16:37
问题 I have developed a web application(flexdashboard) in runtime shiny by importing excel data into rmarkdown. I want to deploy it on a server which should work in real time i.e;i will share the link with users so that the end users can see what is happening in real time and the changes that are made to the data in excel data would also be reflected in the web app i.e; dashboard. Please let me know on how to deploy this Rmarkdown web app on Linux server (or any cost efficient server)? Also please

Conditional font color R Markdown

扶醉桌前 提交于 2019-12-23 04:31:45
问题 I am unable to find a way to include dynamic font colors in R Markdown based on the value of a variable (>0, ==0, or <0). Could anyone help? I tried an if statement where the return value is latex syntax, but that errored out. To be clear, I'm looking for PDF output. Here's what I tried: ```{r setup, include=FALSE} x <- 4 ``` This is an R Markdown document. `r if (x>0) {\textcolor{red}{Markdown}} else if (x==0) {\textcolor{blue}{Markdown}} else {\textcolor{yellow}{Markdown}}` In this dummy

Conditional font color R Markdown

我怕爱的太早我们不能终老 提交于 2019-12-23 04:31:03
问题 I am unable to find a way to include dynamic font colors in R Markdown based on the value of a variable (>0, ==0, or <0). Could anyone help? I tried an if statement where the return value is latex syntax, but that errored out. To be clear, I'm looking for PDF output. Here's what I tried: ```{r setup, include=FALSE} x <- 4 ``` This is an R Markdown document. `r if (x>0) {\textcolor{red}{Markdown}} else if (x==0) {\textcolor{blue}{Markdown}} else {\textcolor{yellow}{Markdown}}` In this dummy

Variable as title in rmarkdown

丶灬走出姿态 提交于 2019-12-23 02:34:37
问题 In short : how can I print a html-header inside a chunk in rmarkdown (use a variable to create a header inside a code-chunk)? In long : Let's say I have a number of variables in my dataset (names also stored in the vector 'Vars'), and each group of 3 variables belongs to the same subject. I can make a loop to plot all the variables, but I want the subject in a title. Something like: Subject 1 Plot Var1 Plot Var2 Plot Var3 Subject 2 Plot Var 4 Plot Var 5 ... Following pseudo-code hopefully

How to download multiple reports created using R markdown and R shiny in a zip file

随声附和 提交于 2019-12-23 02:28:29
问题 I have created an R shiny application to download dynamic reports using R Markdown. Previously I was downloading one report at a time by selecting the row in the data table in r shiny and clicking on download button, the selected row's column values would get filled in the report, this was working perfectly fine. But now i am trying to download multiple reports, so that if I select multiple rows in a datatable in r shiny and click on download, the number of reports downloaded should be equal

How can I change dpi inline code output in notebook Rmarkdown

*爱你&永不变心* 提交于 2019-12-22 18:37:13
问题 I know how to change the dpi of a plot when knitting a rmarkdown notebook to html. However is there a way to change the dpi of a plot generated in a rmarkdown notebook without having to knit the document, id est the plot is shown as inline output between two code chunks while working on the notebook? 来源: https://stackoverflow.com/questions/53884985/how-can-i-change-dpi-inline-code-output-in-notebook-rmarkdown

How can the backticks (`) printed around these tables be escaped?

不打扰是莪最后的温柔 提交于 2019-12-22 18:35:02
问题 In Align multiple tables side by side, a user asks about aligning tables, and the (very good) answer provided involves using latex in a chunk with the results returned as is to LaTeX. This is correct for that users question. I am curious if this can be easily converted into an inline (i.e. not in chunk) solution. \begin{table}[!htb] \begin{minipage}{.5\linewidth} \caption{} \centering, `r t1`, \end{minipage}% \begin{minipage}{.5\linewidth} \centering \caption{}, `r t2`, \end{minipage} \end

Correct Mathjax source in RStudio and RMarkdown

孤人 提交于 2019-12-22 18:20:36
问题 I create a R Markdown file in RStudio , then I click on the Knit HTML button on the top of the screen to create and save an HTML page which I want to use elsewhere, say store it on my server. The problem with the HTML file, is that it contains <script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> which is not valid anymore, and when I edit the HTML and change the source to the following it works. https:/