# Create vector of daily closing prices for a hypothetical stock
prices <- c(100.4, 98.7, 101.3, 101.0, 100.9)
# Overall growth is 0.50%
prices.rate(prices)
# Average daily growth is 0.12%
prices.rate(prices, 1)
# Corresponds to 36.6% annual growth
prices.rate(prices, 251)
Run the code above in your browser using DataLab