Re: [Rcpp-devel] inline error

2013-10-29 Thread Hadley Wickham
Oops, so this would be better: library(Rcpp) cppFunction("int x(NumericVector start) { return 1; }") Hadley On Mon, Oct 28, 2013 at 12:29 PM, Romain Francois wrote: > Just a warning that this code creates a NumericVector of length 1 initialised > with 0. > > 1 is not a NumericVector so the c

Re: [Rcpp-devel] inline error

2013-10-28 Thread Romain Francois
Just a warning that this code creates a NumericVector of length 1 initialised with 0. 1 is not a NumericVector so the compiler looks for a conversion, the one that is found is the ctor for NumericVector that takes an int. Romain Le 28 oct. 2013 à 17:05, Hadley Wickham a écrit : > FYI, that

Re: [Rcpp-devel] inline error

2013-10-28 Thread Hadley Wickham
FYI, that's equivalent to the somewhat cleaner library(Rcpp) cppFunction("NumericVector x(NumericVector start) { return 1; }") Hadley On Mon, Oct 28, 2013 at 8:58 AM, Simon Zehnder wrote: > Dear Rcpp::Users and Rcpp::Devels, > > I get a weird error when using inline and I want to know, where

Re: [Rcpp-devel] inline error

2013-10-28 Thread Dirk Eddelbuettel
On 28 October 2013 at 14:15, Wray, Christopher wrote: | Its just a typo on plugin (no s). And scope Rcpp::wrap. | | cfunc <- cxxfunction( signature(start="vector"), body = 'Rcpp::NumericVector x(start); return Rcpp::wrap(1);', plugin = "Rcpp" ) | | extra 's' on parameter plugins | | or | | cf

Re: [Rcpp-devel] inline error

2013-10-28 Thread Simon Zehnder
You are right! Too long time in front of my desktop…. Apology! On 28 Oct 2013, at 15:15, Wray, Christopher wrote: > Its just a typo on plugin (no s). And scope Rcpp::wrap. > > cfunc <- cxxfunction( signature(start="vector"), body = 'Rcpp::NumericVector > x(start); return Rcpp::wrap(1);', p

Re: [Rcpp-devel] inline error

2013-10-28 Thread Wray, Christopher
Its just a typo on plugin (no s). And scope Rcpp::wrap. cfunc <- cxxfunction( signature(start="vector"), body = 'Rcpp::NumericVector x(start); return Rcpp::wrap(1);', plugin = "Rcpp" ) extra 's' on parameter plugins or cfunc <- cxxfunction( signature(start="vector"), body = 'using namespace Rc