returns: 'returns'

Description Usage Arguments Value Author(s) Examples

View source: R/returns.R

Description

Computes periodic returns from a dataframe ordered by date

Usage

1
returns(df = dflong, retType = "abs", period.return = 1, spread = FALSE)

Arguments

df

Long dataframe with colnames = c("date","value","series")

retType

"abs" for absolute, "rel" for relative, or "log" for log returns.

period.return

Number of rows over which to compute returns.

spread

TRUE if you want to spread into a long dataframe.

Value

A dataframe object of returns.

Author(s)

Philippe Cote

Examples

1
2
returns(df = dflong,retType = "abs",period.return = 1,spread = TRUE)
returns(df = dflong,retType = "abs",period.return = 1,spread = FALSE)

RTL documentation built on June 12, 2021, 5:06 p.m.

Related to returns in RTL...