addLogReturns: addLogReturns

Description Usage Arguments Value Examples

View source: R/scrapeData.R

Description

This method computes the log-difference returns in NOTE: First observation cannot have a return value. For computational reasons it has value 0.

Usage

1
addLogReturns(df, value)

Arguments

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

Value

a data.frame with additional columns of the log returns in percent of the specified value(s)

Examples

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"))

wagnertimo/smarketcrawlR documentation built on June 19, 2017, 12:31 p.m.