I have a time series of about 1500 measurements. There are sporadic data
gaps. I would like to plot the time series with type line. I only want
a line to connect the periods with data; I don't want a line to connect
the points across a data gap. Is there a function or recommended method
to
Just place a point with an NA value between the two segments.
Here is one way to do it in zoo:
set.seed(123)
library(zoo)
# create sample data
tt - c(1:1000, 1200:2000)
z - zoo(rnorm(length(tt)), tt)
# this will fill in omitted values with NAs
z - as.zoo(as.ts(z))
plot(z)
On Thu, May 28,
2 matches
Mail list logo