prices_gains: Convert Prices to Gains

Description Usage Arguments Value Examples

View source: R/prices_gains.R

Description

Calculates gains based on vector or matrix of prices.

Usage

1
prices_gains(prices)

Arguments

prices

Numeric matrix with 1 column of prices for each investment (can be a vector if there is only one).

Value

Numeric vector or matrix.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Load 2017 prices for Netflix and Amazon, and calculate growth of $10k
prices <- load_prices(c("NFLX", "AMZN"), initial = 1000)

# Calculate gains
gains <- prices_gains(prices)

## End(Not run)

vandomed/stocks documentation built on Sept. 2, 2018, 10:10 a.m.