Created
December 4, 2015 19:32
-
-
Save bearloga/96ac68585e86e84900b7 to your computer and use it in GitHub Desktop.
This allows the presenter to write and execute R code within the presentation without going back and forth between the presentation and the R console.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Interactive Presentations" | |
author: "Mikhail Popov (@bearloga)" | |
date: "December 4, 2015" | |
output: ioslides_presentation | |
runtime: shiny | |
--- | |
## Reduce Demo | |
`Reduce` uses a binary function to successively combine the elements of a given vector and a possibly given initial value. | |
```{r} | |
A <- month.name[2:6] # February, March, April, May, June | |
B <- month.name[4:10] # April, May, June, July, August, September, October | |
C <- month.name[3*(1:4)] # March, June, September, December | |
D <- month.name[2*(1:6)] # February, April, June, August, October, December | |
``` | |
```{r, echo=FALSE} | |
inputPanel( | |
tags$textarea(id = "ex3", rows = 3, cols = 40, | |
style = "width:700px;font-size:24px;", | |
'intersect(intersect(intersect(A,B),C),D)') | |
) | |
renderPrint({ | |
eval(parse(text = input$ex3)) | |
}) | |
``` | |
<!-- When presenting, replace code in text area with: Reduce(intersect, list(A,B,C,D)) --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When presenting, replace code in text area with: Reduce(intersect, list(A,B,C,D))