#########################################################
Notes on building the R library GenKern:- mainly to me.

If you have the GenKern_1.00.tar.gz file from the distribution and you have just untarred it and are wondering what to do then you need to run as root (from outside R and in a directory GenKern_1.00.tar.gz can be found):

R CMD INSTALL GenKern_1.00.tar.gz

which should install GenKern for you to the default R library directory - you can safely remove the directory tree you created by unpacking this tarball.

looking at:

R CMD INSTALL --help

may also be useful.

NOTE - there is a: R CMD install as well, INSTALL and install are two different things.





##########################################################
Notes to me:

Building the package from the source tree

need to be in the directory above the GenKern Directory then run a: 

R CMD build GenKern

which builds the distribution source so long as all the documentation is ok, and the R source links to any .c or .f source in one of the approved ways you should be fine.

for linking R source to .c stuff I have used:

.First.lib <- function(lib, pkg) library.dynam("GenKern", pkg, lib)

as the line which loads the .c module and is a line I don't really understand - just copied it from another source package.

then use the .C() function to make calls and pass addresses etc to the module



#########################################################
for development I used a directory with all the files just bunged in. The R source has a line:

dyn.load("libGenKern.so")

the file libGenKern.so being made up by:

gcc -lm GenKern.c -c

and to convert that to a .so from .o:

R SHLIB -o libGenKern.so GenKern.o

This is a conveinient way of just putting together working code by sourcing the GenKern.r file leaving the niceities of package making until after working code is established



#######################################################
Write up the documentation as described in writing R extensions by the R core team into *.Rd files

from within the directory use:

R CMD Rdconv -t html KernSec.Rd > KernSec.html

to check the formatting on the Rd files



#######################################################
As root from the directory above the source tree do a

R CMD build GenKern

This will return some warnings from v1.00 on as there are several 'hidden' functions - these warnings can safely be ignored

Which will build the package into GenKern_X.XX.tar.gz

Then from the directory with the .tar.gz in as root install by

R CMD INSTALL GenKern

which will compile it - it's all very clever and easy.

To get rid of a package do:

R CMD REMOVE GenKern

Note REMOVE is not the same as remove
######################################################
Wish list for version 1.20

1 - More kernel forms - possibly even a beta despite Robert not being too keen on them

2 - A trivariate function - trivariates can be simulated for two continuous and a discrete - I'd like to do a proper three continuous and above dimensions

3 - Circular variables - ie wrapping of the density

4 - A window parameter selection function - possibly select local window parameters as well

copyright David Lucy 30th August 200a - dlucy@maths.ed.ac.uk
