RChart in R Markdown does not display

I am having problems with rChart rendering done with "nPlot" when I paste an R Markdown document into html.

I followed the solution discussed in this question , but it was unsuccessful.

Here is my .Rmd code

```{r, echo=FALSE}
library(knitr)
```
---
title: "Untitled"
author: "Test"
date: "01/23/2015"
output: html_document
---

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r}
summary(cars)
```

You can also embed plots, for example:

```{r, echo=FALSE}
plot(cars)
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

# Here is an rChart
```{r, echo=FALSE, results='asis', comment=NA}
library(rCharts)
m2 <- nPlot(speed ~ dist, data = cars, type = "scatterChart")
m2$show('iframesrc', cdn = TRUE)
```
That was an rChart

Here is the link to the html document from this code. I created and created this in RStudio, and the rendering does not appear on my local computer and when it loads into Dropbox.

When I run the following code in the console and save as html, I get this rendering .

library(rCharts)
m2 <- nPlot(speed ~ dist, data = cars, type = "scatterChart")
m2$save('test3.html', standalone = TRUE)
+4
source share
3 answers

GET IT.

see this answer: Ramnath lowered it

( , , /...)

n1$print('iframesrc', cdn =TRUE, include_assets=TRUE)

, - . , .

, . , rCharts .

install_github("ramnathv/rCharts")
+5

, , . , .

...

```{r set-options, echo=FALSE, cache=FALSE}
options(RCHART_WIDTH = 1000, RCHART_HEIGHT = 400)
```

```{r, echo=FALSE, cache=T, results='asis', comment=NA}
p1 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart')
p1$print('chart1', include_assets=T)
```

```{r, echo=FALSE, cache=T, results='asis', comment=NA}
hair_eye = as.data.frame(HairEyeColor)
p2 <- nPlot(Freq ~ Hair, group = 'Eye', data = subset(hair_eye, Sex == "Female"), type = 'multiBarChart')
p2$print('chart2', include_assets=T)
```

:

  • results='asis' comment=NA , .
  • cdn=T . R .
  • , .
  • R 3.1.2, rCharts_0.4.5, rmarkdown_0.7
+2

You can save your rChart chart as html and then include it in your RMarkdown document with shiny::includeHTML("plot.html"). It worked for me.

0
source

All Articles