4

I am trying to use nPlot because I wanted to add some controls to the plot. I am just copying a basic example from here http://ramnathv.github.io/posts/rcharts-nvd3/index.html and it doesn't show any plot when I run it. I use hPlot and it shows up fine. Do I need to install anything else? Here is the two basic examples. hPlot is working, nPlot shows no chart.

library(rCharts)

h1 <- hPlot(x="wt",y="mpg",group="cyl",data=mtcars,type="scatter")
h1

library(rCharts)

p1 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart')
p1$xAxis(axisLabel = 'Weight (in lb)')
p1

Also I originally tried to use nPlot with the actual data I want to plot and added a control. The control shows up fine but no plot. Tried with the basic example and still no plot. Thanks.

user3646105
  • 2,459
  • 4
  • 14
  • 18
  • Have you tried updating possibly relevant packages like rCharts and shiny? Have you tried `p1$show("server")` or `p1$show(static = FALSE)`? – lukeA Aug 23 '14 at 13:01
  • Are you trying to view the plot in Rstudio viewer or your browser? What OS are you on? – Ramnath Aug 24 '14 at 03:23
  • 1
    If you are on Windows, for some reason `nvd3` plot will not show up in the Rstudio viewer, but will show up just fine if you press the button to show it in the browser, or if you set `options(viewer=NULL)` prior to plotting. – timelyportfolio Aug 25 '14 at 01:36
  • Thanks guys. Yes I am using Rstudio w/windows and trying to use Rstudios viewer. If I show in the browser it comes up correctly. – user3646105 Aug 25 '14 at 21:55

0 Answers0