I recently experimented with slidify and rCharts . The tutorials for creating simple diagrams when using slidify are explanatory, but I could not find such a tutorial regarding rCharts.
For example, I know that the following generates an interactive plot
data(mtcars) r1<- rPlot(mpg ~ wt | am + vs, data=mtcars, type="point") data(iris) hair_eye = as.data.frame(HairEyeColor) rPlot(Freq ~ Hair | Eye,color = 'Eye', data = hair_eye, type = 'bar')
However, I do not know how to include the result in my slides using slidify .
EDIT - after a helpful comment
I tried the following after seeing it on Ramnath git :
--- title : Practice subtitle : makes perfect author : Noob job : framework : io2012 # {io2012, html5slides, shower, dzslides, ...} highlighter : highlight.js # {highlight.js, prettify, highlight} hitheme : tomorrow # widgets : [nvd3] # {mathjax, quiz, bootstrap} mode : selfcontained # {standalone, draft} --- ```{r setup, message = F, echo = F} require(rCharts) options(RCHART_WIDTH = 800, RCHART_HEIGHT = 500) knitr::opts_chunk$set(comment = NA, results = 'asis', tidy = F, message = F) ``` ## NVD3 Scatterplot ```{r echo = F} data(mtcars) n1 <- nPlot(mpg ~ wt, group = 'gear', data = mtcars, type = 'scatterChart') n1$print('chart1') ```
But ended up with this error:
Error in file(con, "r") : cannot open the connection In addition: Warning message: In file(con, "r") : cannot open file 'libraries/widgets/nvd3/nvd3.html': No such file or directory
After which I decided to copy the nvd3 folder from Ramnath widgets directly to mine, hoping that this would solve the issue. However, this madly showed the Ramnath git page, as well as my slides in the background!
What to do? I would really appreciate any recommendations / recommendations / recommendations on how to accomplish this task. And hopefully this question will help other newbies like me to use the wonderful rCharts.
Note. I use the standard editor for R, not R-studio. I feel the first is less cluttered.