Include interactive local R in presentation
Asked Answered
B

2

6

In presentations we often want to demonstrate R interactively. This requires exiting the presentation and demonstrating outside of the slides or running a limited (Things like install_github can't be used), unreliable (because Internet is unreliable in presentations) cloud based version of R (as seen in the code below). How could a local version of R be run from within an HTML presentation? In a similar fashion we can use iframe HTML tags to include videos etc. within a presentation. This could make the presentation more seamless and flow better.

I know plotting tasks are likely much more difficult and would require a specific gui such as RStudio. If that's possible it would be great but even if it were at a low level, that is include the OS command line with R booted up in the presentation. Basically it would be like iframe-ing R from the command line or Rstudio within the .Rmd/.html document/presentation.

This would be able to be incorporated into the slidify, knitr as an .Rmd or within the R Presentation (.Rpres) slide shows available in the latest version of RStudio.

So here's a version of this idea using a cloud based R that could be knit as a .Rmd file. This is a starting point but being tied to a cloud is not ideal:

R in HTML
<iframe width='100%' height='300' src='http://www.r-fiddle.org/#/embed?id=e63tlTG8' allowfullscreen='allowfullscreen' frameborder='0'></iframe>
Bevan answered 14/12, 2013 at 16:18 Comment(5)
Put R on a memory stick.Paulinepauling
Embed r-fiddle.org as an iframe.Education
@Education I had thought of that and updated just before you commented, but the local version is ideal for presentations.Bevan
I think the right way to think about this is not as an R-specific solution, but rather how to get a shell into a presentation. These tex posts (1, 2) look like they have some decent ideas, as does this superuser post.Education
This can be done with Slidify. See this blog post. It uses Shiny when run locally, and switches to OpenCPU when posted online (the OpenCPU binding is broken currently due to the update in OpenCPU).Sauncho
H
3

Speaking of Rstudio, you could simply install, on your presentation computer, the RStudio server version which runs in a browser. You can then simply use an IFRAME as you want:

<iframe width='100%' height='300' src='http://localhost:8787' frameborder='0'></iframe>

Plots and figures work exactly as in RStudio regular version.

Homicidal answered 14/12, 2013 at 17:46 Comment(0)
D
2

One option is Shiny app (or even multiple apps listening on different ports) running locally on your laptop. You will need a shiny app rendering your visual(s). Shiny can run from command line R.

Primitive shiny app takes 20-30 min to master (subjective opinion) and can incorporate arbitrary complex visualization produced with R.

Doralynn answered 14/12, 2013 at 17:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.