x <- data.frame(date = as.Date(c("2014-04-22", "2014-04-22")),
currency = c("USD", "EUR"),
tenor = c(5, 5),
spread = c(120, 110),
coupon = c(100, 100),
recovery = c(0.4, 0.4),
notional = c(10000000, 10000000),
stringsAsFactors = FALSE)
CS10(x)
Run the code above in your browser using DataLab