# type mismatch in Rquantlib Bond.cpp

I've been tracing back through bond.cpp and find the following in FloatingBond() :

double dayCounter = Rcpp::as<double>(datemisc["dayCounter"]);


$\mathrm{datemisc[]}$ is passed (traced back to) from FloatingBond.default in bond.R as

dateparams=list(....
dayCounter='Thirty360',
....)


which is a string, so I would assume that it would be a pointer to a string in c++.

Looking downstream to $\mathrm{dayCounter()}$ in util.cpp I see

QuantLib::DayCounter getDayCounter(const double n){
if (n==0)
return QuantLib::Actual360();
else if (n==1)
return QuantLib::Actual365Fixed();
.......
}


So downstream agrees with the type passed but the upstream in bond.R seems incorrect. I do not see where the text string is translated into a double.

What am I missing?

• I should add this is true for the other parameters in "dataparams", the functions expect doubles but I see string pointers passed. – terry leitch Mar 14 '16 at 18:37