Description Usage Arguments Value Note See Also Examples
Calculates returns between values with specified lag.
1 |
x |
A numeric vector containing the values for which returns are calculated. |
lag |
Integer indicating which lag to use (default: 1). |
na_padding |
Flag whether to pad truncated values with NA's (default: TRUE). |
Numeric vector with returns of specified lag.
Parameter na_padding
behaves slightly different from diff
in order to achieve consistency with lead
and lag
.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.