Friends

I am looking at Rcpp and I am a bit stuck on a simple matter.

(I am calling R from c++, if there is a better way...)

Given this simple example using the TTR package and the SMA function which
returns a simple moving average....

Rcpp::NumericVector rv;
    for(int i = 0; i < 100; i++){
      rv.push_back(rand());
    }
    Rcpp::Environment TTR("package:TTR");
    Rcpp::Function sma = TTR["SMA"];
    SEXP sma_res = sma(rv);

How do I get the values of sma_res from a SEXP type into something
useful in C++, like a vector<float>?

Where can I find some documentation of SEXP?  I have tried googling it
to no avail.

cheers
Worik

	[[alternative HTML version deleted]]

