4

我想将时间序列显示为高图交互式图形。但是,在以下 R 脚本中,日期并未全部正确显示。日期的数值在五位之后被削减,使它们都出现在同一天和同一时间。有没有人经历过并解决过类似的事情?

library(plyr)
library(rCharts)
library(rHighcharts)
cs <-c("13-10-30 12:30:00", "13-10-30 12:35:00", "13-10-30 12:40:00", 
       "13-10-30 12:45:00", "13-10-30 12:50:00", "13-10-30 12:55:00")
x <-strptime(cs, "%y-%m-%d %H:%M:%S")
dfr <-data.frame(date=as.POSIXct(x,origin="1970-01-01"),
                 value=c(1.5,1.25,.75,2.1,1.3,1.4))

hpl <- hPlot(
  value~date,
  data = dfr,
  type = "scatter"
)

hpl$xAxis(type = "datetime")
hpl$chart(zoomType = "x")
hpl$plotOptions(
  line = list(
  marker = list(enabled = F)
 )
)
hpl
4

0 回答 0