Re: [Rcpp-devel] trouble creating a dataframe

2012-06-05 Thread Jiqiang Guo
what did you mean by your C++ app? On Tue, Jun 5, 2012 at 2:35 PM, Dirk Eddelbuettel wrote: > in my C++ app. ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] Memory error when using Dimension

2012-06-05 Thread Dirk Eddelbuettel
On 5 June 2012 at 13:19, Douglas Bates wrote: | Some time ago I mentioned memory errors that seemed to be related the | the Rcpp::Dimension class but I couldn't pin them down. I have a more | detailed, although not necessarily reproducible, example now. | | In the merPredD::condVar method define

Re: [Rcpp-devel] trouble creating a dataframe

2012-06-05 Thread Dirk Eddelbuettel
On 5 June 2012 at 10:32, Pratibha Rana wrote: | I tried the code that you suggested on The R prompt and it worked as expected. | However the same piece of code doesn't work in my C++ app. | | try{ |         IntegerVector v = IntegerVector::create(1,2,3); |         std::vector s(3); |         s[0]

Re: [Rcpp-devel] trouble creating a dataframe

2012-06-05 Thread Pratibha Rana
I tried another approach, and this one was also futile. try{ int size = argTypes.getColumnCount(); std::vector inputVectors; inputVectors.reserve(3); StringVector nameVec(size); NumericVector lenVec(size) ; NumericVector scaleVec(size) ; fo

[Rcpp-devel] Memory error when using Dimension

2012-06-05 Thread Douglas Bates
Some time ago I mentioned memory errors that seemed to be related the the Rcpp::Dimension class but I couldn't pin them down. I have a more detailed, although not necessarily reproducible, example now. In the merPredD::condVar method defined in the lme4/src/predModule.cpp source file there is the

Re: [Rcpp-devel] trouble creating a dataframe

2012-06-05 Thread Pratibha Rana
I tried the code that you suggested on The R prompt and it worked as expected. However the same piece of code doesn't work in my C++ app. try{ IntegerVector v = IntegerVector::create(1,2,3); std::vector s(3); s[0] = "a"; s[1] = "a"; s[2] = "a"; DataF

Re: [Rcpp-devel] Including a compiled function with inline

2012-06-05 Thread Marie Auger-Methe
Thank you! It works great! Here is what I did: src <- ' using namespace Rcpp; double y = 9; NumericVector z(1); z[0] = 100.1; f1(y, z); z[0] = z[0] + 1; return z; ' f2 <- cxxfunction(signature(), body = src, plugin = "Rcpp", includes = "#include ") This is my c