prices_gains {stocks}R Documentation

Convert Prices to Gains

Description

Calculates gains based on vector or matrix of prices.

Usage

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

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



[Package stocks version 1.1.4 Index]