ts_regular | R Documentation |
Enforces regularity in data frame and xts
objects, by turning implicit
NA
s into explicit NA
s. In ts
objects, regularity is automatically
enforced.
ts_regular(x, fill = NA)
x |
ts-boxable time series, an object of class |
fill |
numeric, instead of |
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
.
x0 <- AirPassengers
x0[c(10, 15)] <- NA
x <- ts_na_omit(ts_dts(x0))
ts_regular(x)
ts_regular(x, fill = 0)
m <- mdeaths
m[c(10, 69)] <- NA
f <- fdeaths
f[c(1, 3, 15)] <- NA
ts_regular(ts_na_omit(ts_dts(ts_c(f, m))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.