The R (or S-plus) and c code needed consists of the two files; migrlib.R and migrlib.c. In addition, the c part of the code uses randlib for random number generation. These files and accompanying documentation (the file you're reading) can be downloaded from this url (see Table 1).
migrlib.R | R (or S-Plus) functions |
migrlib.c | c-code for generating bootstrap samples |
migrlib-doc.tex | LATEX file for generating this documentation |
migrlib-doc.pdf | This documentation in portable document format |
randlib.c | c-library for random number generation |
randlib.h | |
linpack.c | |
com.c |
The randlib library may also be downloaded separately from from this url.
The first thing to do is to compile the c routines together with randlib. On the Unix system I used at one point in time, which had S-plus installed, there was a special command for compiling c code for later loading into S-plus. The following command
s+compile -o all.o -g linpack.c com.c randlib.c migrlib.cfrom the OS-prompt, seemed to do the trick, but this will vary between different operating systems. This will probably be different on, for example, a Windows95 platform. It should be described somewhere in S-plus' documentation.
Dynamic loading of shared libraries in R is presently only implemented on unix version, for example linux. On this platform, the shared library ``all.so'' can be compiled as follows:
gcc -g -O2 -fpic -c *.c ld -shared -o all.so *.o
After having compiled the c code, start S-plus (or R), and load the library into R (or into S-Plus) with the command
> source("migrlib.R")In doing this, the compiled c code is also loaded through the command