[R] getting package version inside .First.lib

Adrian Baddeley adrian at maths.uwa.edu.au
Thu Jan 27 12:31:18 CET 2005


Thanks, Brian. 

So, to print the version number when 'mypackage' is loaded,

.First.lib <- function(lib, pkg) {
    library.dynam("mypackage", pkg, lib)
    vvv <- read.dcf(file=system.file("DESCRIPTION", package="mypackage"), 
                    fields="Version")
    cat(paste("mypackage", vvv, "\n"))
}




More information about the R-help mailing list