Re: [Rd] bug in acosh (win32) (PR#9403)

2006-12-03 Thread tshort
> This is a bug in the mingw runtime, and not in R. So the difference is > between OSes, not between R versions. Note that > > > acosh(2) > [1] 1.316958 > > acosh(2+0i) > [1] 0+NaNi > > acosh(2+1e-10i) > [1] 1.316958+0i > > so it seems to be happening only for exactly real complex numbers. >

Re: [Rd] passing matrix as argument to a C function

2006-12-03 Thread Christos Hatzis
Thank you, Dirk. I'll keep this in mind. -Christos -Original Message- From: Dirk Eddelbuettel [mailto:[EMAIL PROTECTED] Sent: Sunday, December 03, 2006 12:47 PM To: [EMAIL PROTECTED] Cc: 'Prof Brian Ripley'; r-devel@r-project.org Subject: Re: [Rd] passing matrix as argument to a C func

Re: [Rd] R 2.4.1 scheduled for December 18

2006-12-03 Thread Gregor Gorjanc
Hi! If I am not wrong issue described at http://thread.gmane.org/gmane.comp.lang.r.devel/9667/focus=9667 did not get any attention. Thought it is true that using names() instead of colnames() does not change mode of data.frame rownames. This issues are also "alive": http://thread.gmane.org/gm

Re: [Rd] passing matrix as argument to a C function

2006-12-03 Thread Dirk Eddelbuettel
On 3 December 2006 at 11:47, Christos Hatzis wrote: | Thank you. The code in kmeans.c is indeed informative. One needs to | remember that an R matrix is a vector with attributes. In case there is any chance that you could turn your part of the source from C into C++, try RcppTemplate from CRAN

Re: [Rd] passing matrix as argument to a C function

2006-12-03 Thread Christos Hatzis
Thank you. The code in kmeans.c is indeed informative. One needs to remember that an R matrix is a vector with attributes. -Christos -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Sunday, December 03, 2006 3:25 AM To: Christos Hatzis Cc: r-devel@r-project.o

Re: [Rd] bug in acosh (win32) (PR#9403)

2006-12-03 Thread ripley
This is a bug in the mingw runtime, and not in R. So the difference is between OSes, not between R versions. Note that > acosh(2) [1] 1.316958 > acosh(2+0i) [1] 0+NaNi > acosh(2+1e-10i) [1] 1.316958+0i so it seems to be happening only for exactly real complex numbers. I think there are also pr

Re: [Rd] passing matrix as argument to a C function

2006-12-03 Thread Prof Brian Ripley
The data in an R matrix is not stored as double **A, but as double *A: it is just a vector in R, with attributes. There are lots of examples of manipulating R matrixes via .C: one is src/library/stats/src/kmeans.c. The code for crossprod is not at all hard to find: it is in src/main/array.c.