0

I'm sure this is an easy question but I cannot seem to find the answer. Just starting out with R and rCharts and I'm trying to create a line chart with week on the horizontal axis and two price variables as the series. The data is just a standard data frame with columns Week, Price1, and Price2. I've tried:

n1 <- nPlot(Price1 + Price2 ~ Week, data=quotes, type = "lineChart")

but that does not plot any of the series. If I take out Price 1 or Price 2 and the "+" it works fine, but is there a way to plot both simultaneously? I know about the group= option, but I'd rather not have to restructure the data to get that to work.

Any help would be appreciated.

tonytonov
  • 25,060
  • 16
  • 82
  • 98

1 Answers1

0

As far as I know, this is not possible. Currently, most of the rCharts libraries work with long data, so reshape2::melt is your friend. Based on the question, it sounds like you are aware of how to accomplish this, but I am happy to help if you need.

timelyportfolio
  • 6,479
  • 30
  • 33