[R] Calcuting returns

Patrick Burns pburns at pburns.seanet.com
Thu Jan 6 19:12:42 CET 2011


I'm guessing this page will answer
your question:
http://www.portfolioprobe.com/2010/10/04/a-tale-of-two-returns/

If not, then you need to be more
specific.

On 06/01/2011 18:07, Amelia Vettori wrote:
> Dear R forum helpers,I have following datatrans<- data.frame(currency_transacted = c("EURO", "USD", "USD", "GBP", "USD", "AUD"), position_amt = c(10000, 25000, 20000, 15000, 22000, 30000))date<- c("12/31/2010", "12/30/2010", "12/29/2010", "12/28/2010", "12/27/2010", "12/24/2010", "12/23/2010", "12/22/2010", "12/21/2010", "12/20/2010")USD<- c(112.05, 112.9, 110.85, 109.63, 108.08, 111.23, 112.49, 108.87, 109.33, 111.88)GBP<- c(171.52, 168.27,169.03, 169.64, 169.29, 169.47, 170.9, 168.69, 170.9, 169.96)EURO<- c(42.71, 42.68, 41.86, 44.71, 44.14, 44.58, 41.07, 42.23, 44.55, 41.12)CHF<- c(41.5, 41.47, 42.84, 43.44, 43.69, 42.3, 42.05, 41.23, 42.76, 43.79)AUD<- c(109.55, 102.52, 114.91, 122.48, 122.12, 123.96, 100.36, 110.19, 121.58, 103.46)These are the exchange rates and I am trying calculating the returns. I am giving only a small portion of actual data as I can't send this as an attachment.Actually, I have stored these as csv files (i.e. as
>   transactions.csv and currency.csv files respectively) in my
>
>
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Patrick Burns
pburns at pburns.seanet.com
twitter: @portfolioprobe
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of 'Some hints for the R beginner'
and 'The R Inferno')



More information about the R-help mailing list