[Rd] Inconsistencies (PR#550)
Mon, 22 May 2000 16:45:51 +0800 (WST)
>>>>> "BDR" == Prof Brian D Ripley <email@example.com> writes:
BDR> On Mon, 22 May 2000 firstname.lastname@example.org wrote:
>> Dear all,
>> I was playing around with some C-code that I dynamically linked to R
>> and noticed the following inconsistency:
BDR> I can find no inconsistency. [...]
BDR> For example, if printit.c is
BDR> void printit(double *x, int *n)
BDR> int i;
BDR> for(i = 0; i < *n; i++) printf("[%d] %f\n", i, x[i]);
>> dat <- matrix(1,3,3)
BDR>  TRUE
>> invisible(.C("printit", dat, as.integer(9)))
BDR>  1.000000 [...]
Sorry, mea culpa. My C-code was a bit more complicated and I know
realise that I had screwed up within the C-routine. By the time the
C-code was fixed, I had an `as.double(dat)' in my call to .C but was
still under the impression that the problems where due to the fact
that R past a matrix that it claimed to be in storage mode double as
an integer matrix to the C-routine....
BDR> I think the moral is that you cannot assume the storage mode of
BDR> expressions returned by R (or by S).
I guess the moral is rather that I should believe that I found a bug
in R when I am fooling around with some code around midnight ;-/ Or
that I should check better for the sources of my alleged bugs.....
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: email@example.com