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