Hello All,

A simple question.

I get some return from the R in my C++ program (via Rcpp package). The
result come, as SEXP and it should be a simple numeric variable.

How to convert it to double?

The code, what i use:

stringstream ss;
ss << "p <- predict(fit_ar11, n.ahead = 2, doplot=FALSE);"
     << "p$pred[1]";

SEXP ans;
int iRet = R.parseEval(ss.str().c_str());
if (iRet == 0 && ans != NULL)
{

    // ???
}

Cheers,
Dima

	[[alternative HTML version deleted]]

