2

This is my code:

library(datasets)
library(rCharts)
haireye = as.data.frame(HairEyeColor)
n1 = nPlot(Freq ~ Hair, group = 'Eye', type = 'multiBarChart', data = subset(haireye, Sex == 'Male'))
n1$save('fig/n1.html', cdn = TRUE)
cat('<iframe.src = "fight/n1.html" width = 100%, height = 600></iframe>')

If I just run

n1

it opens up the graph. However, when I try to open the saved file, it only displays a blank page. What am I doing wrong?

ytk
  • 2,787
  • 4
  • 27
  • 42
  • I ran your code and was able to open `n1.html` without any problems, so at least it doesn't seem to be a coding problem. – eipi10 Jun 05 '15 at 03:40
  • Any idea what I'm doing wrong? I'm on a Mac. Does that make a difference? – ytk Jun 05 '15 at 03:49
  • Not sure. Hopefully someone will have some suggestions. I ran your code on a mac and opened the file in Firefox. – eipi10 Jun 05 '15 at 03:52
  • 1
    Change n1$save('fig/n1.html', cdn = TRUE) to n1$save('fig/n1.html', standalone = TRUE), I'm pretty sure there was a post on that. – Jon Nagra Jun 05 '15 at 08:22
  • @JonNagra yeah that worked thank you! – ytk Jun 05 '15 at 13:54

0 Answers0