Skip to content
Prev 2204 / 10988 Next

[Rcpp-devel] how to use functions from other packages

Thanks Dirk.  I was hoping for an example of the use of R functions in 
Rcpp and did take a look at your Journal of Statistical software paper 
but was hoping for more than is there on this issue.
Maybe someone can post a full example.

On a different issue, I tried the inline example in your JSS paper on my 
Windows 7 machine after loading the inline library

src = '
Rcpp::NumericVector xa(a);
Rcpp::NumericVector xb(b);
int n_xa = xa.size(), n_xb = xb.size();

Rcpp::NumericVector xab(n_xa + n_xb - 1);
for (int i = 0; i < n_xa; i++)
for (int j = 0; j < n_xb; j++)
xab[i + j] += xa[i] * xb[j];
return xab;
  '
fun <- cxxfunction(signature(a = "numeric", b = "numeric"),
  src, plugin = "Rcpp")

  R> fun(1:3, 1:4)

and got the following error message

Error in system(cmd, intern = !verbose) : 'C:/Program' not found

What could the problem be?

Thanks in advance on both scores.

Siddhartha.
On 4/23/2011 9:25 PM, Dirk Eddelbuettel wrote:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110424/45dfa1e6/attachment.htm>