x <- as.data.frame(tapply(read.csv("~/f3.csv")$quantity,read.csv("~/f3.csv")$ticker,sum))
colnames ( x) [1] <- "shares"
z <- as.data.frame(tapply(read.csv("~/f3.csv")$quantity,read.csv("~/f3.csv")$ticker,sum))
colnames ( z) [1] <- "shares"
z2 <- transform( z, ticker=rownames ( z))
my_pf <- transform(z2,currency=mapply(function(x) read.csv("~/f3.csv")[grep(x,read.csv("~/f3.csv")$ticker),5][1],my_pf$ticker))
mapply ( my_getsymbols, my_pf$currency, 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)
beep ( 1)
tapply(my_pf$total,my_pf$currency,sum)["JPY"] + tapply(my_pf$total,my_pf$currency,sum)["USD"] * last(USDJPY)
z <- as.data.frame(tapply(read.csv("~/f3.csv")$quantity,read.csv("~/f3.csv")$ticker,sum))
z2 <- transform
my_pf <- transform(z2,currency=mapply(function(x) read.csv("~/f3.csv")[grep(x,read.csv("~/f3.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)
0 件のコメント:
コメントを投稿