Re: [Rcpp-devel] Matrix columns

2011-05-15 Thread Nick Sabbe
: Dirk Eddelbuettel [mailto:e...@debian.org] > Sent: zondag 15 mei 2011 21:22 > To: Nick Sabbe > Cc: 'Dirk Eddelbuettel'; rcpp-de...@r-forge.wu-wien.ac.at > Subject: RE: [Rcpp-devel] Matrix columns > > > Nick, > > I fear that you think that because data.frame

Re: [Rcpp-devel] Matrix columns

2011-05-15 Thread Dirk Eddelbuettel
Nick, On 15 May 2011 at 20:51, Nick Sabbe wrote: | Hi Dirk. Thanks for your time and trouble. | I agree there are simpler ways to achieve this functionality, but if I don't | get around this, I won't be able to produce the thing I'm really after. I fear that you think that because data.frame is

Re: [Rcpp-devel] Matrix columns

2011-05-15 Thread Nick Sabbe
Hi Dirk. Thanks for your time and trouble. I agree there are simpler ways to achieve this functionality, but if I don't get around this, I won't be able to produce the thing I'm really after. > Why is retMat on the right-hand side if you try to fill it? Makes no real sense. >From rcpp-quickref:

Re: [Rcpp-devel] Matrix columns

2011-05-14 Thread Dirk Eddelbuettel
On 14 May 2011 at 23:12, Nick Sabbe wrote: | I?ve been trying the following, with the main part ripped from rcpp-quickref: | | SEXP dfr2Mat(SEXP dfr) A much easier way is to, say, call as.matrix() in R and then assign to an NumericMatrix object in C++. Another way is turn the Data.Frame i

Re: [Rcpp-devel] Matrix columns

2011-05-14 Thread Michael Braun
h taking a look. Michael On May 14, 2011, at 5:33 PM, wrote: > > Message: 5 > Date: Sat, 14 May 2011 23:12:08 +0200 > From: "Nick Sabbe" > Subject: [Rcpp-devel] Matrix columns > To: > Message-ID: <02a301cc127b$95e964c0$c1bc2e40$@sa...@ugent.be> > Co

[Rcpp-devel] Matrix columns

2011-05-14 Thread Nick Sabbe
Hi all, I've been trying the following, with the main part ripped from rcpp-quickref: SEXP dfr2Mat(SEXP dfr) { DataFrame df = dfr; int* dm = INTEGER( ::Rf_getAttrib( df, R_DimSymbol ) ) ; int rows = dm[0]; int cols = dm[1]; NumericMatrix re