xa is now computed in the R environment and passed into C++ via function argument