x <- as.data.frame(tapply(read.csv("~/f4.csv")$quantity,read.csv("~/f4.csv")$ticker,sum))
z <- as.data.frame(tapply(read.csv("~/f4.csv")$quantity,read.csv("~/f4.csv")$ticker,sum))
z2 <- transform
my_pf <- transform(z2,currency=mapply(function(x) read.csv("~/f4.csv")[grep(x,read.csv("~/f4.csv")$ticker),5][1],my_pf$ticker))
my_pf <- transform(my_pf,total=mapply(function(x,y) x*last(get(as.character(y))[,4]),z2$shares,z2$ticker))
tapply(my_pf$total,my_pf$currency,sum)["JPY"] + tapply(my_pf$total,my_pf$currency,sum)["USD"] * last(USDJPY)
tapply(my_pf$total,my_pf$currency,sum)["JPY"] / last(USDJPY) + tapply(my_pf$total,my_pf$currency,sum)["USD"]
0 件のコメント:
コメントを投稿