| diff | R Documentation |
tind and tdiff Objectsdiff method for tind and tdiff works in a standard way.
For all index types except for integer and numeric indices, differences
of time indices are retuned as objects of tdiff class.
## S3 method for class 'tind'
diff(x, lag = 1L, differences = 1L, ...)
## S3 method for class 'tdiff'
diff(x, lag = 1L, differences = 1L, ...)
x |
an object of |
lag |
an integer value. |
differences |
an integer value. |
... |
(ignored) further arguments passed to or from other methods. |
An object of tdiff class, except for x argument
of tind class of type "i" or "n" (integer/numeric
indices), in which case an integer or numeric vector is returned.
Ops.
(nn <- sample(1:10))
(x <- today() + nn)
# all 3 should be the same
diff(x, 2, 2)
as.tdiff(diff(nn, 2, 2), "d")
diff(as.tdiff(nn, "d"), 2, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.