] On Behalf Of Tyler Smith
Sent: Tuesday, April 26, 2005 11:02 AM
To: R-Help
Subject: [R] Advice for calling a C function
Hi,
I'm having some trouble with a bit of combined C R code. I'm trying to
write a C function to handle the for loops in a function I'm working on
to calculate a similarity matrix
]
[mailto:[EMAIL PROTECTED] On Behalf Of Tyler Smith
Sent: Tuesday, April 26, 2005 11:02 AM
To: R-Help
Subject: [R] Advice for calling a C function
Hi,
I'm having some trouble with a bit of combined C R code. I'm trying to
write a C function to handle the for loops in a function I'm working
Hi,
I'm having some trouble with a bit of combined C R code. I'm trying to
write a C function to handle the for loops in a function I'm working on
to calculate a similarity matrix. Jari Oksanen has kindly added the
necessary changes to the vegan package so that I can use the vegdist
function,
I think it is a problem with matrices in R and C being stored in different
row/column order
void gowsim ( double *mat, int *OBJ, int *MATDESC) {
double x [*MATDESC][*OBJ];
int i, j, nrow, ncol;
nrow = *OBJ;
ncol = *MATDESC;
/* Rebuild Matrix */
for (j=0; j ncol; j++)