You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to draw a simple time series plot. I have a date variable and a numeric variable. But when I try to do the graph using rCharts, it doesn't recognize my date variable as a date. Here is my gist file https://gist.github.com/blaquans/7140811
Do you have any solution ?
The text was updated successfully, but these errors were encountered:
Very good question. We are working towards a more universal implementation of the R to JS date conversion as referenced by #43 , but as of now, each of the JS libraries handles dates differently. For Rickshaw as shown in your example, this will work.
require(rCharts)
fake <- data.frame(date = seq(as.Date("1990-01-01"), as.Date("1991/01/01"), by = "day"))
fake$x <- rnorm(nrow(fake))
str(fake)
fake$d <- as.numeric(as.POSIXct(fake$date))
r <- Rickshaw$new()
r$layer(x ~ d, data = fake, type = "line")
r$show()
@ramnathv wrote a little function to ease the conversion for Rickshaw.
In general JS likes dates in as.numeric(as.POSIXct(myRdate)) * 1000. Hope this helps. Please let us know if it does not.
I'd like to draw a simple time series plot. I have a date variable and a numeric variable. But when I try to do the graph using rCharts, it doesn't recognize my date variable as a date. Here is my gist file https://gist.github.com/blaquans/7140811
Do you have any solution ?
The text was updated successfully, but these errors were encountered: