# Method 1: use the Return.excess function from PerformanceAnalytics, 
# then calculate the Sharpe Ratio manually.
portfolio_excess_returns <- Return.excess(portfolio_monthly_returns, Rf = .0003)
sharpe_ratio_manual <- round(mean(portfolio_excess_returns)/StdDev(portfolio_excess_returns), 4)

# If we wanted to use the original, 1966 formulation of the Sharpe Ratio, there is one small 
# change to the code in Method 1.
# sharpe_ratio_manual <- round(mean(portfolio_excess_returns)/StdDev(portfolio_monthly_returns), 4)
  
# Method 2: use the built in SharpeRatio function in PerformanceAnalytics.
sharpe_ratio <- round(SharpeRatio(portfolio_monthly_returns, Rf = .0003), 4)