我有一系列跨越多天的时间序列数据,在每个相邻的两天之间存在一个没有数据点的时间段。如何在使用ggplot2
绘制时间序列图时省略这些时间段?
以下是一个人工示例,我该如何去除两个没有数据的时间段?
代码:
Time = Sys.time()+(seq(1,100)*60+c(rep(1,100)*3600*24, rep(2, 100)*3600*24, rep(3, 100)*3600*24))
Value = rnorm(length(Time))
g <- ggplot()
g <- g + geom_line (aes(x=Time, y=Value))
g