ggplot2 time series plotting: how to omit periods when there is no data points?

前端 未结 3 1728
广开言路
广开言路 2020-12-15 21:08

I have a time series with multiple days of data. In between each day there\'s one period with no data points. How can I omit these periods when plotting the time series usin

3条回答
  •  Happy的楠姐
    2020-12-15 21:27

    csgillespie mentioned padding by NA, but a simpler method is to add one NA after each block:

    Value[seq(1,length(Value)-1,by=100)]=NA
    

    where the -1 avoids a warning.

提交回复
热议问题