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
lugin = "Rcpp" ) > > both work. > > From: [email protected] > on behalf of Simon Zehnder > > Sent: 28 October 2013 13:58 > To: [email protected] > Subject: [Rcpp-devel] inlin

Re: [Rcpp-devel] inline error

2013-10-28 Thread Wray, Christopher
ature(start="vector"), body = 'using namespace Rcpp; NumericVector x(start); return wrap(1);', plugin = "Rcpp" ) both work. From: [email protected] on behalf of Simon Zehnder Sent: 28 Octobe

[Rcpp-devel] inline error

2013-10-28 Thread Simon Zehnder
Dear Rcpp::Users and Rcpp::Devels, I get a weird error when using inline and I want to know, where it comes from. I run the following code: library(Rcpp) library(inline) cfunc <- cxxfunction(signature(start="vector"), body = "Rcpp::NumericVector x(start); return 1;", plugins = "Rcpp”) And I ge