[Rcpp-devel] data.frame from R to C++?

2011-04-07 Thread deqiang sun
Hi all, Suppose I want to read a csv file including TEXT and NUMBER fields in R by function read.table. Is there a way to use the result in C++? Like the way I use in R, say, 2nd column is x[,2], 3rd row is x[3,]. I have gone through the examples in RInside and did not find anything helpful. P

Re: [Rcpp-devel] Help on compilation of Rcpp and RInside

2011-04-07 Thread Dirk Eddelbuettel
Hi Deqiang, On 7 April 2011 at 17:55, deqiang sun wrote: | Hi Dirk, | Thanks for your help. My pleasure. | I did not see that there's a Makefile in the example folder:) I felt like an idiot. Stuff happens, there are now a number of files in there. | I just put Makefile under Eclipse source

Re: [Rcpp-devel] Help on compilation of Rcpp and RInside

2011-04-07 Thread deqiang sun
Hi Dirk, Thanks for your help. I did not see that there's a Makefile in the example folder:) I felt like an idiot. I just put Makefile under Eclipse source folder and it compiles/links. All tests passed, though I have to remove older version of R and install the required newer version of R to a

Re: [Rcpp-devel] OpenMP and Rcpp - compiler error

2011-04-07 Thread Davor Cubranic
On 2011-04-06, at 9:45 PM, Michael Braun wrote: > I've tried the MacPorts route, and it takes forever. Perhaps this is a > MacPorts problem, but I've found that it consumes all available system > resources as it compiles all possible dependencies before even getting to the > compilation of gcc

Re: [Rcpp-devel] Help on compilation of Rcpp and RInside

2011-04-07 Thread Dirk Eddelbuettel
(Please don't post twice.) On 7 April 2011 at 05:20, deqiang sun wrote: | Hi all, | | Could someone help me on compilation of the RInside/inst/examples/standard/rinside_sample0.cpp. This example is the project Rinside0 created by eclipse. | | And here is the error message for build. | |

Re: [Rcpp-devel] Accessing/copying rows/colums of matrices

2011-04-07 Thread Dirk Eddelbuettel
On 6 April 2011 at 22:41, Christian Gunning wrote: | "On 7 April 2011 at 00:31, Michael Braun wrote: | | A couple of weeks ago, I posted a problem in compiling and running one of the | | examples from the Rcpp-quickref pdf. " | | Good point -- short edit to quickref is attached. Nice! Applied

Re: [Rcpp-devel] Accessing/copying rows/colums of matrices

2011-04-07 Thread Dirk Eddelbuettel
On 7 April 2011 at 01:25, Michael Braun wrote: | Yes! Adding the using namespace Rcpp line did the trick. Thank you. Cool! | Might I suggest adding this trick to the documentation? Many (most? just me?) R users are simply looking for ways to do statistics faster, and just don't have the sam

[Rcpp-devel] Help on compilation of Rcpp and RInside

2011-04-07 Thread deqiang sun
Hi all, Could someone help me on compilation of the RInside/inst/examples/standard/rinside_sample0.cpp. This example is the project Rinside0 created by eclipse. And here is the error message for build. Build of configuration Debug for project Rinside0 make all Building file: ../src/

Re: [Rcpp-devel] Problem passing Armadillo objects back to R

2011-04-07 Thread Romain Francois
Le 07/04/11 05:07, Christian Gunning a écrit : The issue is that when calling wrap it creates an unprotected SEXP, and Rcpp is not responsible for these. If the programmer passes an unprotected SEXP to ::create, it is his responsability to protect it. Just to clarify -- in the case of a naive u