Description Usage Arguments Details Value Examples
View source: R/ts_pad_contig.R
Apply stats::na.contiguous()
to a timeseries x
and pad the
result back to its original length with NA
s. Designed for use in
data.table[, j = pad_contiguous(x), by = g]
, where the replacement
needs to have the same length as the original.
1 |
x |
Either a numeric vector, or |
Preserves start
and frequency
of x
, if it is a
stats::ts()
object.
An object of class(x)
and length(x)
with NA
s,
except for the longest contiguous stretch in x
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.