Aqui una solución utilizando `monthlyReturn` e `(s)lapply` library(quantmod) portfolio_monthly_returns=lapply(xts(df[,-1],order.by = df$Date),monthlyReturn) portfolio_excess_returns <- lapply(portfolio_monthly_returns,Return.excess, Rf = .0003) sharpe_ratio_manual <- function(portfolio_excess_returns){ md=mean(portfolio_excess_returns) sd=StdDev(portfolio_excess_returns) is=round( mean(portfolio_excess_returns) / StdDev(portfolio_excess_returns), 4 ) c(MD=md,SD=sd,IS=is)} sapply(portfolio_excess_returns,sharpe_ratio_manual) O resultado será similar a: #> sapply(portfolio_excess_returns,sharpe_ratio_manual) # Asset1 Asset2 Asset3 Asset4 Asset5 #MD 0.00512297 0.03089434 0.02469234 0.02832768 0.02017995 #SD 0.09343994 0.26828429 0.21592801 0.24191859 0.20906925 #IS 0.05480000 0.11520000 0.11440000 0.11710000 0.09650000