Displaying 2 results from an estimated 2 matches for "nmtest".
Did you mean:
qmtest
2006 Mar 02
1
calling R's library using C
Hi,
Thanks, everyone for all the help! So, here is my calling function in C
(called
test.c):
#include<stdio.h>
#include<stdlib.h>
#include<Rmath.h>
int main(void) {
printf("%f \n",pchisq(2.,7., 1, 0));
printf("%f \n",pnchisq(2.,7.,0., 1, 0));
return EXIT_SUCCESS;
}
I compile using:
gcc test.c -I/usr/lib/R/include
2006 Mar 03
1
Fwd: Re: calling R's library using C
...lib/R/lib ./globetrotter
> > 0.040160
> > 0.040160
> >
> > That said, I put "fine" in quotes as you shouldn't need either -lR nor the
> > include directive. Witness:
> >
> > edd at basebud:/tmp> cp /usr/share/doc/r-mathlib/examples/test.c nmtest.c
> > edd at basebud:/tmp> gcc -o nmtest nmtest.c -lm -lRmath
> > edd at basebud:/tmp> ./nmtest
> > edd at basebud:/tmp> tail -6 nmtest.c
> > main()
> > {
> > /* something to force the library to be included */
> > qnorm(0.7, 0.0, 1.0, 0, 0);...