r-markdown

Create Shiny Presentation from Shiny App?

你说的曾经没有我的故事 提交于 2019-12-03 16:35:21
I found this - http://shiny.rstudio.com/gallery/download-knitr-reports.html - awesome example that can create static PDFs, HTMLs, and Word Docs. What I want to be able to do is upload a data set that can then generate a templatized Shiny Presentation. I've tried multiple routes with little success. The furthest I've gotten is including this code in my markdown file: --- title: "shinyPresentation" author: "maloneypatr" date: "Wednesday, September 03, 2014" output: ioslides_presentation: self_contained: false lib_dir: libs runtime: shiny --- Upon trying to download the sample .HTML file, I get

Adjust the size of plotly charts in slidify

故事扮演 提交于 2019-12-03 16:23:50
I've created a plotly chart in R and then save the plot via htmlwidget so the plot can called in slidify. I played with width and height , in both layout argument and index.Rmd to fit the plot on a slidify slide but the final result always cut the bottom portion of the chart when some texts are added together. How can I truly adjust the size of the plotly chart in slidify? The code in R script ## first slide date <- seq(from = as.POSIXct("2015/4/1"), to = as.POSIXct("2015/10/1"), by = "month") as.Date(date, "%Y/%m/%d") set.seed(2016) tot.prem <- runif(n = 7, min = 0, max = 1200) pol.frce <-

Add line numbers to text content of a rendered rmarkdown html document

二次信任 提交于 2019-12-03 15:48:54
I am writing a report in Rmarkdown which shall be rendered in html because it contains Rshiny chunks. Is there any way I can add line numbers to the file? Importantly I need line numbers for the text and not for the code chunks as asked here . I wonder if it is possible to add some CSS to the .Rmd file below but wouldn't know how to do that. --- title: "Title" author: "Yourname" date: "June 16, 2016" output: html_document runtime: shiny --- This R Markdown document is made interactive using Shiny. Unlike the more traditional workflow of creating static reports, you can now create documents

Conditional formatting of a table in RShiny

℡╲_俬逩灬. 提交于 2019-12-03 15:18:44
I'm trying to visualize a cohort analysis, and wanted to use RenderDataTable in shiny to get this sort of a visualization where I would be able to highlight all the cells based on a separate column having values 1/0, with 1 being shaded and 0 not being shaded. I Tried a couple of things, including trying to use geom_tile in ggplot2 , but it was of no avail. I also tried looking at rpivotTable , but I wasn't able to figure out how to shade certain cells. Example Data: df <- " cohort wk value flag 1 1 24 0 1 2 12 0 1 3 10 0 1 4 5 0 1 5 2 0 2 1 75 0 2 2 43 1 2 3 11 0 2 4 14 0 3 1 97 0 3 2 35 0 3

How to show output in console when writing an RMarkdown notebook?

谁都会走 提交于 2019-12-03 15:09:54
问题 I have a simple question, and I think I'm just not looking in the right place, or RStudio is not acting as expected. I'd like to know if there is an option to output the results of all my markdown code chunks to go to the plots window or the console. I'm starting to use R Notebooks to write in R Markdown. Say I type the command head(cars) into my .Rmd document. I press Ctrl + Enter, and the line is run. Up pops the first 6 lines of the cars dataframe into my script. I see that the line has

Edit title slide of R Markdown Slidy Presentation

雨燕双飞 提交于 2019-12-03 15:03:39
问题 Is there a way to edit the title slide of a R Markdown Slidy Presentation? I am able to add the header, footer, and custom css: title: "Slidy Template" author: "" date: "June 18, 2015" runtime: shiny output: slidy_presentation: css: ./styles/Slidy_Styles.css includes: after_body: ./styles/doc_suffix.html before_body: ./styles/header.html But I can't figure out how to either add anything besides title, author, and date to the slide, or else replace the standard slidy title slide with a custom

Is it possible to include svg image in pdf document rendered by rmarkdown?

不羁的心 提交于 2019-12-03 14:22:33
I want an svg image to be embedded in an pdf document that I render by using rmarkdown. This doesn't seem possible, or do I miss something? If it's not possible is there a way to first convert the .svg image to a .png before embedding it? In my rmarkdown file it looks like this (notice the two different kinds of inserting the image): ```{r results="asis",eval=TRUE,echo=FALSE,message=FALSE, error=FALSE, warning=FALSE, comment = NA,fig.height=10} cat("![](svg_file.svg)") ``` ![](svg_file.svg) I found a solution that works for me. It is based on using the svg LaTeX package and some LaTeX code

“long vectors not supported yet” error in Rmd but not in R Script

戏子无情 提交于 2019-12-03 14:21:12
问题 I am operating matrices with R 3.1 and RStudio 0.99. I have my R Script and with cmd+enter it works without problem. I created an Rmd for reporting but I have this error Error in lazyLoadDBinsertVariable(vars[i], from, datafile, ascii, compress, : long vectors not supported yet: ../../../../R-3.3.1/src/main/connections.c:5600 Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> lazyLoadDBinsertVariable Execution halted Is there a way to bypass that error? This seems to be a dupicate of Large

Mass create documents in R markdown

ぃ、小莉子 提交于 2019-12-03 14:10:49
I'm wondering if anyone can help me with a dilemma I'm having. I have a dataset of around 300 individuals that contains some basic information about them (e.g. age, gender). I want to knit a separate R markdown report for each individual that details this basic information, in Word format. And then I want to save each report with their unique name. The actual code which sits behind the report doesn't change, only the details of each individual. For example: Report 1: "Sally is a female who is 34 years old". (Which I would want to save as Sally.doc) Report 2: "Mike is a male who is 21 years old

knit HTML does not save html in vignettes/

僤鯓⒐⒋嵵緔 提交于 2019-12-03 13:31:37
So I have a vignette, vignettes/test-vignette3.Rmd : --- title: "Sample Document" output: html_document: highlight: kate theme: spacelab toc: yes pdf_document: toc: yes --- Header ========= When I hit the knit HTML button, I get the following: processing file: test-vignette3.Rmd output file: test-vignette3.knit.md Output created: /tmp/RtmpKVpegL/preview-5ef42271c0d5.dir/test-vignette3.html However, if I copy this file to inst/doc and hit the knit HTML button, I get: processing file: test-vignette3.Rmd output file: test-vignette3.knit.md Output created: test-vignette3.html My questions are: How