如何为功能合并添加0?

时间:2019-05-24 13:08:19

标签: r

我有三个数据框,每个产品(通用货币,期限,看涨期权)的特定货币的价差金额。 对于公款,我有3种货币,分别是条款21和通话15。 我想对特定货币的每个金额进行查询,但我认为我无法执行此操作,因为每种产品中的货币金额不完全相同。

您是否知道如何在vlookup中以没有价差的货币放入0? 或如何解决此代码?

对不起,如果您不了解我。

#Spread Tab
CCY <- c("AUD","CAD","CHF","CZK","DKK","EUR","GBP","HKD","JPY","MXN","NOK","NZD","PLN","RUB","SEK","SGD","TRY","USD","XAG","XAU","XPD","XPT","ZAR")
Spread <- data.frame(CCY)
Spread_Commloans<-aggregate(CommsPL$Spread1, by = list(CommsPL$Currency1), FUN=sum)
Spread_Terms <-aggregate(TermsPL$Spread2, by = list(TermsPL$Currency2), FUN=sum)
Spread_Calls <-aggregate(CallsPL$Spread3, by = list(CallsPL$Currency3), FUN=sum)

Spread<-merge(x = Spread, y= Spread_Commloans[,c("Group.1","x")],by.x="CCY",by.y="x")
Spread<-merge(x = Spread, y= Spread_Terms[,c("Group.1","x")],by.x="CCY",by.y="x")
Spread<-merge(x = Spread, y= Spread_Calls[,c("Group.1","x")],by.x="CCY",by.y="x")

这是我的错误输出; c CCY Group.1.x Group.1.y Group.1

0 个答案:

没有答案