. . . > You also nmeed to disentangle the assignment as there is too much template > magic. So this just worked for me: > > > R> library(Rcpp) > R> library(inline) > R> > R> xorig <- c(1, -2, 3, -4, 5, -6, 7) > R> > R> code <- ' > + NumericVector x(xs); > + NumericVector xa = sapply( x, ::fabs ); > + return(xa); > + ' > R> > R> xabs <- cxxfunction(signature(xs="numeric"), > + plugin="Rcpp", > + body=code) > R> > R> xabs(xorig) > [1] 1 2 3 4 5 6 7 > R> . . .
That works perfectly. Thanks, Dirk. -- Mike
_______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
