Skip to content

Currency return calculations

2 messages · Amelia Vettori, PIKAL Petr

#
Hi

What is wrong with my suggestion then.
USD    GBP  EURO   CHF    AUD
1  112.05 171.52 42.71 41.50 109.55
2  112.90 168.27 42.68 41.47 102.52
3  110.85 169.03 41.86 42.84 114.91
4  109.63 169.64 44.71 43.44 122.48
5  108.08 169.29 44.14 43.69 122.12
6  111.23 169.47 44.58 42.30 123.96
7  112.49 170.90 41.07 42.05 100.36
8  108.87 168.69 42.23 41.23 110.19
9  109.33 170.90 44.55 42.76 121.58
10 111.88 169.96 41.12 43.79 103.46
USD        USD.1          CHF          AUD        USD.2
2   0.007557271  0.007557271 -0.000723153 -0.066323165  0.007557271
3  -0.018324535 -0.018324535  0.032501971  0.114091312 -0.018324535
4  -0.011066876 -0.011066876  0.013908430  0.063798538 -0.011066876
5  -0.014239366 -0.014239366  0.005738567 -0.002943583 -0.014239366
6   0.028728436  0.028728436 -0.032332157  0.014954765  0.028728436
7   0.011264199  0.011264199 -0.005927700 -0.211195211  0.011264199
8  -0.032709819 -0.032709819 -0.019693240  0.093442427 -0.032709819
9   0.004216322  0.004216322  0.036436939  0.098366334  0.004216322
10  0.023056037  0.023056037  0.023802395 -0.161387418  0.023056037
As I said instead fiddling with several loop/if/function/variables attempt 
it seems to me better to use powerful R indexing and "whole object" 
approach where it is possible.

Regards
Petr



Amelia Vettori <amelia_vettori at yahoo.co.nz> napsal dne 07.01.2011 
13:46:53:
w.r.t.
exchange
"12/29/
"12/22/2010",
109.33, 111.88),
170.9, 169.96),
41.12),
43.79),
121.
transactions. i.e
giving
my
forCHF and AUD.
causing
time. Its
I