Description Usage Arguments Value See Also Examples
Generic function for removing leading and trailing NA
s.
1 |
object |
an object. |
... |
further arguments passed to methods. |
sides |
character specifying whether |
is.na |
If "any" then a row will be regarded as |
An object in which leading and/or trailing NA
s have been
removed.
na_approx
, na_contiguous
,
na_locf
, na_omit
, na_spline
,
stinterp
, zoo
1 2 3 4 5 6 7 8 9 10 11 12 13 | # examples of na_trim
x <- zoo(c(1, 4, 6), c(2, 4, 6))
xx <- zoo(matrix(c(1, 4, 6, NA, 5, 7), 3), c(2, 4, 6))
na_trim(x)
na_trim(xx)
# using na_trim for alignment
# cal defines the legal dates
# all dates within the date range of x should be present
cal <- zoo(,c(1, 2, 3, 6, 7))
x <- zoo(c(12, 16), c(2, 6))
na_trim(merge(x, cal))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.