Re: [R] Matrix variable in C code

From: Gabor Csardi <csardi_at_rmki.kfki.hu>
Date: Fri 03 Feb 2006 - 04:47:06 EST

On Thu, Feb 02, 2006 at 06:27:47PM +0100, depire@inrets.fr wrote: [...]

The problem is that as.double drops the dim attribute:
> b <- matrix( 1:4, 2, 2)
> b

     [,1] [,2]
[1,] 1 3
[2,] 2 4
> as.double(b)

[1] 1 2 3 4
>

You can try:

> b <- matrix( 1:4, 2, 2)
> d <- dim(b)
> b <- as.double(b)
> b

[1] 1 2 3 4
> dim(b) <- d
> b

     [,1] [,2]
[1,] 1 3
[2,] 2 4

Another thing is that i cannot really see why the ZT parameter of the .Call should be a matrix anyway. It's just the vector (40 21 30 20). Or am i missing something?

Also, this is an unrelated issue but your VPCEfron C function takes five parameters and the R code provides six....

Gabor

> =====================================
>
> You can save these two simple programs in order to test my code.
>
> Thanks.
>
[...]

-- 
Csardi Gabor <csardi@rmki.kfki.hu>    MTA RMKI, ELTE TTK

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Feb 03 05:00:39 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:17 EST