ts_na_omit | R Documentation |
Remove NA values in ts-boxable objects, turning explicit into implicit missing values.
ts_na_omit(x)
x |
ts-boxable time series, an object of class |
Note that internal NAs in ts
time series will not be removed, as this
conflicts with the regular structure.
a ts-boxable object of the same class as x
, i.e., an object of
class ts
, xts
, zoo
, zooreg
, data.frame
, data.table
, tbl
,
tbl_ts
, tbl_time
, tis
, irts
or timeSeries
.
ts_regular, for the opposite, turning implicit into explicit missing values.
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)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.