HertieDataScience / SyllabusAndLectures

Hertie School of Governance Introduction to Collaborative Social Science Data Analysis
MIT License
37 stars 60 forks source link

rCharts in io_slides presentation #28

Open christophergandrud opened 9 years ago

christophergandrud commented 9 years ago

A number of students have had difficulties getting rCharts to show up in io_slides presentations.

Here is a minimal example that shows how to include rCharts:

 ---
title: "Untitled"
date: "4 December 2014"
 output: ioslides_presentation

---

## Chart Example

```{r, echo=FALSE, results='asis'}
library(rCharts)

hair_eye_male <- subset(as.data.frame(HairEyeColor), Sex == "Male")
n1 <- nPlot(Freq ~ Hair, group = "Eye", data = hair_eye_male, 
  type = 'multiBarChart')
n1$print('testChart', cdn = TRUE, include_assets = TRUE)

The key is to include the content delivery network (CDN) and assets (mostly a bunch of JavaScript) using the arguments cdn = TRUE, include_assets = TRUE in the print function.

oliverbott commented 9 years ago

Thanks for this info. Alas, it doesn´t help. It neither works for our presentation nor for your minimal example code.

christophergandrud commented 9 years ago

We'll figure it out later I guess.

For today everyone can simply present their slides off of there own computer.