x <- AirPassengers
x[c(2, 4)] <- NA
# A ts object does only know explicit NAs
head(ts_na_omit(x))
# by default, NAs are implicit in data frames
head(ts_df(x))
# make NAs explicit
head(ts_regular(ts_df(x)))
# and implicit again
head(ts_na_omit(ts_regular(ts_df(x))))
Run the code above in your browser using DataLab