Description Usage Arguments Value Examples
This method computes the log-difference returns in NOTE: First observation cannot have a return value. For computational reasons it has value 0.
1 | addLogReturns(df, value)
|
df |
- a data.frame with financial data @seealso getDailyOHLC |
value |
- a single character value (e.g. "Close") or a character vector (e.g. c("Close", "Volume")) to define the value(s) on which to compute the return |
a data.frame with additional columns of the log returns in percent of the specified value(s)
1 2 3 4 | # Get the financial data
prices <- getDailyOHLC("09.2014-11.2014", "DE0007037145")
# Calculate the log returns in percent
log.returns <- addLogReturns(prices, c("Close", "Volume"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.