Re: [Rd] can one modify array in R memory from C++ without copying it?

2011-11-01 Thread Simon Urbanek
On Nov 1, 2011, at 9:08 PM, andre zege wrote: > Hi, guys. I posted this by accident at rcpp-dev, although it meant to > be only to r-dev, so don't flame me here please, rcpp guys will > do it there, i am sure :). > I have some pretty large arrays in R and i wanted to do some time > consuming modi

Re: [Rd] reducing a too-large matrix obtained with allocMatrix()

2011-11-01 Thread Simon Urbanek
On Nov 1, 2011, at 4:29 PM, Steven Dirkse wrote: > Hello, > > I have some C code (for a shared lib called via .External) that uses > > PROTECT(w= allocMatrix(REALSXP, m, n)); > > mostly successfully. In rare cases, though, the row count m will be > an overestimate. Is there a way to realloc

[Rd] can one modify array in R memory from C++ without copying it?

2011-11-01 Thread andre zege
Hi, guys. I posted this by accident at rcpp-dev, although it meant to be only to r-dev, so don't flame me here please, rcpp guys will do it there, i am sure :). I have some pretty large arrays in R and i wanted to do some time consuming modifications of these arrays in C++ without actually copying

[Rd] reducing a too-large matrix obtained with allocMatrix()

2011-11-01 Thread Steven Dirkse
Hello, I have some C code (for a shared lib called via .External) that uses PROTECT(w= allocMatrix(REALSXP, m, n)); mostly successfully. In rare cases, though, the row count m will be an overestimate. Is there a way to reallocate the matrix in-place, something like reAllocMatrix (w,m-excess,

Re: [Rd] Question about copying reference objects using the initialize method

2011-11-01 Thread Martin Morgan
On 10/31/2011 08:53 AM, Aleix Ruiz de Villa wrote: Dears, I have a question about copying reference objects using the initialize method. 1) If the latter has no arguments, there is no problem to copy an object. myClass = setRefClass("myClass", fields = list(value = "numeric") ) myClass$method

Re: [Rd] R CMD check and error in an \Sexpr in an Rd file

2011-11-01 Thread Georgi Boshnakov
Dear Renaud, > Getting back to the \Sexpr issue, I tried with R-2.14.0 and I still see > the following issues: > > - verbatim multiline is not shown properly on PDF > (\Sexpr[results=verbatim, stage=render]{cat("line\nnext line")}) You probably meant to use `paste', not `cat'. The latter sends i

[Rd] Question about copying reference objects using the initialize method

2011-11-01 Thread Aleix Ruiz de Villa
Dears, I have a question about copying reference objects using the initialize method. 1) If the latter has no arguments, there is no problem to copy an object. myClass = setRefClass("myClass", fields = list(value = "numeric") ) myClass$methods(initialize = function(...){   value <<- 1   callS

Re: [Rd] R CMD check and error in an \Sexpr in an Rd file

2011-11-01 Thread Renaud Gaujoux
Getting back to the \Sexpr issue, I tried with R-2.14.0 and I still see the following issues: - verbatim multiline is not shown properly on PDF (\Sexpr[results=verbatim, stage=render]{cat("line\nnext line")}) - verbatim with empty lines breaks PDF generation (\Sexpr[results=verbatim, stage=ren