On 2 March 2006 at 19:37, Globe Trotter wrote:
| > Thanks for all the help. I thought I would clarify certain things. First, I
| > did
| > not read that section of the manual (no one provided the pertinent link),
I'd do it now. Really. Not later. *Now*. Like the Posting Guide recommends.
You may have heard of the sites www.r-project.org and cran.r-project.org. If
you look closely, you will discover a link 'Manuals' on the left. You'd be
surprised. All that you are griping about here is in Section 5.15 of the
'Writing R Extension' manual.
| > library (and define that MATH_STANDALONE), I get errors: in particular, it
| > would not recognize set_seed (which is a function which should work only if
No problem here -- see below for you altered program and output.
| > (English is not my strong suit, but I can follow there, I am sure): btw, I
do
| > not have the /usr/share/doc/r-mathlib/ directory, nor is it anywhere on
| > my
Because you're on Red Hat, and I am on Debian.
| > system (as per the output to locate), I really thank you for all your help!
I
| > am sure Professor Ripley would also appreciate your support.
He really doesn't need my help, but I am flattered by the suggestion.
Hope this helps, Dirk
[EMAIL PROTECTED]:/tmp> cat globetrotter.c
#include<stdio.h>
#include<stdlib.h>
#define MATHLIB_STANDALONE 1
#include <Rmath.h>
int main(void) {
set_seed(42, 43);
printf("Random with fixed seed: %f\n", unif_rand());
printf("%f \n",pchisq(2.,7., 1, 0));
printf("%f \n",pnchisq(2.,7.,0., 1, 0));
return EXIT_SUCCESS;
}
[EMAIL PROTECTED]:/tmp> gcc -o globetrotter globetrotter.c -lm -lRmath
[EMAIL PROTECTED]:/tmp> ./globetrotter
Random with fixed seed: 0.692304
0.040160
0.040160
[EMAIL PROTECTED]:/tmp> ./globetrotter
Random with fixed seed: 0.692304
0.040160
0.040160
[EMAIL PROTECTED]:/tmp>
--
Hell, there are no rules here - we're trying to accomplish something.
-- Thomas A. Edison
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html