0

I am trying to use a local CSV data file to create a Dygraph plot in R.

It seems everywhere I look the structure is below:

  g = new Dygraph(document.getElementById("div"),
                  data,
                  { options });

So far I have below:

library(dygraphs)# Calling ggplot 2 library

data <- read.csv("C:/Users/test/Documents/R/R-3.3.1/R CODE/MyData2.csv", header = TRUE) # reading .csv

My initial thought was:

new Dygraph(data <- read.csv("C:/Users/test/Documents/R/R-3.3.1/R CODE/MyData2.csv", header = TRUE) # reading .csv,
            { labels: [ "series1", "series2","series3"] });

How can I create a Dygraph by using csv.read.

Thanks.

Techno04335
  • 1,365
  • 6
  • 22
  • 43
  • It seems you are mixing R and javascript code. How exactly are you trying to run this? A more complete [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) might help. – MrFlick Mar 29 '17 at 15:07
  • @MrFlick, it seems you are right the first part is JS. It now makes sense. Thanks for the clarification. I just want to create a digraph plot by using data from a local csv. – Techno04335 Mar 29 '17 at 15:15
  • if you want to use R, see https://rstudio.github.io/dygraphs/ – MLavoie Mar 30 '17 at 10:49

0 Answers0