.First.lib <- function(libname, pkgname)
{
    fullName <- paste("package", pkgname, sep=":")
    myEnv <- as.environment(match(fullName, search()))
    dataFile <- file.path(libname, pkgname, "R", "all.rda")
    rm(.First.lib, envir = myEnv)
    load(dataFile, myEnv)
    if(exists(".First.lib", envir = myEnv, inherits = FALSE)) {
        f <- get(".First.lib", envir = myEnv, inherits = FALSE)
        if(is.function(f))
            f(libname, pkgname)
        else
            stop(paste("package \"", pkgname,
                       "\"has a non-function .First.lib", sep=""))
    }
}
#  This file is required even if empty.  It causes the package to
#  to be installed with save image and causes the S4 methods
#  and classes to be assigned in the correct package database.

require(methods) 
require(nlme) 
