Re: [Rd] cerr and cout not working calling c++ from R

2011-05-06 Thread Sean Robert McGuffee
This is a good idea as to converting to stringstream's because it could let me remove cout and cerr from the equation. At the moment, I get that feeling from the experts that having cout and cerr is causing a bug by not mixing with R. I have other cases where algorithms that avoid cout and cerr are

Re: [Rd] cerr and cout not working calling c++ from R

2011-05-06 Thread Dirk Eddelbuettel
On 6 May 2011 at 22:09, Simon Urbanek wrote: | Sean, | | the path form the console is not under your control and it depends heavily on the internal settings in R (is console enabled, is R interactive, is the output a tty or a file ...) - that's why you have to use Rprint/REprintf - that's the

Re: [Rd] cerr and cout not working calling c++ from R

2011-05-06 Thread Simon Urbanek
Sean, the path form the console is not under your control and it depends heavily on the internal settings in R (is console enabled, is R interactive, is the output a tty or a file ...) - that's why you have to use Rprint/REprintf - that's the only path that is guaranteed to work. Anything else

Re: [Rd] Create and access several instances of a C++ class from R

2011-05-06 Thread Dirk Eddelbuettel
Sören and Carlo, On 6 May 2011 at 19:24, soeren.vo...@uzh.ch wrote: | Hello | | We have a C++ class with several methods that manipulate an object. How is | it possible to create several instances of that class *from R* in the C++ | realm, which can then be accessed via a given name character?

[Rd] Create and access several instances of a C++ class from R

2011-05-06 Thread soeren . vogel
Hello We have a C++ class with several methods that manipulate an object. How is it possible to create several instances of that class *from R* in the C++ realm, which can then be accessed via a given name character? Symbolic example (we hope this illustrates our problem): // C++ side: class F

Re: [Rd] cerr and cout not working calling c++ from R

2011-05-06 Thread Sean Robert McGuffee
Hi, Thanks for the comments so far. I've been going through the code extensively and seem to be having trouble reproducing what R is doing, so this confuses me. For example, when I write out the pointer values for ptr_R_WriteConsole type functions, I can't find a function that matches what is act

Re: [Rd] cerr and cout not working calling c++ from R

2011-05-06 Thread Davor Cubranic
On 2011-05-06, at 11:41 AM, Dirk Eddelbuettel wrote: > | I¹m trying to call some of my c++ code from R and seem to be having an issue > | with streams, although that¹s just one obvious sign of something different > | in performance between calling the same function from main in c++ vs. > | calling

Re: [Rd] cerr and cout not working calling c++ from R

2011-05-06 Thread Dirk Eddelbuettel
On 6 May 2011 at 14:21, Sean Robert McGuffee wrote: | Hi, | | Sorry, I just tried posting this but I had it in the wrong format of text, | so this is a cleared format repost: | | I¹m trying to call some of my c++ code from R and seem to be having an issue | with streams, although that¹s just one

[Rd] cerr and cout not working calling c++ from R

2011-05-06 Thread Sean Robert McGuffee
Hi, Sorry, I just tried posting this but I had it in the wrong format of text, so this is a cleared format repost: I¹m trying to call some of my c++ code from R and seem to be having an issue with streams, although that¹s just one obvious sign of something different in performance between calling

[Rd] cerr and cout not working

2011-05-06 Thread Sean Robert McGuffee
Hi, I¹m trying to call some of my c++ code from R and seem to be having an issue with streams, although that¹s just one obvious sign of something different in performance between calling the same function from main in c++ vs. calling the same function from R. I¹m not getting any signs of errors fro

Re: [Rd] Windows Rzlib.dll gzopen and friends

2011-05-06 Thread Martin Morgan
This change has significant consequences for Windows packages using R's zlib, including packages providing core Bioconductor functionality. Are the changes in r55624 meant to be long-term? Martin On 04/29/2011 03:13 PM, Martin Morgan wrote: Several Bioconductor packages were expecting Windows

Re: [Rd] fortan common block

2011-05-06 Thread Duncan Murdoch
On 06/05/2011 11:04 AM, Paul Gilbert wrote: Is it possible in R to call a fortran routine that sets variables in a common block and expect the values to persist when a call is made from R to a second routine that uses the common block? I think the stats package does this; see src/library/stat

[Rd] fortan common block

2011-05-06 Thread Paul Gilbert
Is it possible in R to call a fortran routine that sets variables in a common block and expect the values to persist when a call is made from R to a second routine that uses the common block? If not (as I suspect), is it possible to use a common block in a group of routines that are used toget

Re: [Rd] matrix not positive definite (while it should be)

2011-05-06 Thread Arthur Charpentier
sorry, my mistake... since I build up a correlation matrix, I forgot the fact that the diagonal should be one NR=2 CORRELATION=matrix(c(0.4,-0.25, -0.25,0.3),NR,NR) REGION=sample(1:NR,size=n,replace=TRUE) SIGMA=CORRELATION[REGION,REGION] diag(SIGMA)=1 > min(eigen(SIGMA)$val

Re: [Rd] matrix not positive definite (while it should be)

2011-05-06 Thread Arthur Charpentier
thanks for the tip actually, I know that the covariance matrix has rank 2, but it should still be definite positive (not strictly positive, but positive) my problem is that Cholesky needs a positive matrix... my concern is that I have > min(eigen(SIGMA)$values) [1] -2.109071e-17 while theoretically

Re: [Rd] matrix not positive definite (while it should be)

2011-05-06 Thread Petr Savicky
On Thu, May 05, 2011 at 02:31:59PM -0400, Arthur Charpentier wrote: > I do have some trouble with matrices. I want to build up a covariance matrix > with a hierarchical structure). For instance, in dimension n=10, I have two > subgroups (called REGION). > > NR=2; n=10 > CORRELATION=matrix(c(0.4,-0