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 [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

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

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] trouble creating a dataframe

2012-06-04 Thread Dirk Eddelbuettel
On 4 June 2012 at 18:48, Steve Lianoglou wrote: | On Mon, Jun 4, 2012 at 6:02 PM, Dirk Eddelbuettel wrote: | > | > On 4 June 2012 at 17:28, Pratibha Rana wrote: | [snip] | | > | The value of res was printed at line 159 in Vector__create.h . Using Wrap() | > | makes it worse. I really need help.

Re: [Rcpp-devel] trouble creating a dataframe

2012-06-04 Thread Steve Lianoglou
On Mon, Jun 4, 2012 at 6:02 PM, Dirk Eddelbuettel wrote: > > On 4 June 2012 at 17:28, Pratibha Rana wrote: [snip] > | The value of res was printed at line 159 in Vector__create.h . Using Wrap() > | makes it worse. I really need help. I have been trying to do this for 2 days > | now. > What about

Re: [Rcpp-devel] trouble creating a dataframe

2012-06-04 Thread Dirk Eddelbuettel
On 4 June 2012 at 17:28, Pratibha Rana wrote: | Something seems to go wrong in Vector_create::create__dispatch. | | (gdb) p t1 | $14 = (const Rcpp::traits::named_object, std::allocator >, std::allocator | , std::allocator > > > > | &) @0x7fff5d321780: {name = "datatype", object = std::vector of l

Re: [Rcpp-devel] trouble creating a dataframe

2012-06-04 Thread Pratibha Rana
Something seems to go wrong in Vector_create::create__dispatch. (gdb) p t1 $14 = (const Rcpp::traits::named_object, std::allocator >, std::allocator, std::allocator > > > > &) @0x7fff5d321780: {name = "datatype", object = std::vector of length 2, capacity 2 = {"varchar", "varchar"}} (gdb) p t2 $1

Re: [Rcpp-devel] trouble creating a dataframe

2012-06-04 Thread Dirk Eddelbuettel
Hi Pratibha, On 4 June 2012 at 16:12, Pratibha Rana wrote: | I am at my wits end trying to create  a dataframe from a list of values that I | have. here's the code | | try{ |        int size =  argTypes.getColumnCount(); |        std::vector nameVec(size); |        std::vector lenVec(size); |