Displaying 1 result from an estimated 1 matches for "spot_returns_table".
2011 Jan 07
1
Calculating Returns : (Extremely sorry for earlier incomplete mail)
...ns = NULL
for (i in 1:(length(rate)-1)) # if there are 10 elements, total no of returns = 9
{
currency_rate_returns[i] = log(rate[i]/rate[i+1])
}
currency_rate_returns
return(data.frame(returns = currency_rate_returns))
}
# _______________________________________________
spot_returns_table <- lapply(1:nrow(trans), function(z) with(trans[z, ], spot_trans(currency_trans=trans$currency_transacted)))
spot_returns_table
This generates the output as given below with 30 warnings. Also, as there are six transactions, 6 outputs are generated but the output in all pertains only to the fir...