R/zzz.R

Defines functions .onLoad

.onLoad <- function(libname, pkgname) {
    if(requireNamespace("swephRdata", quietly = TRUE)) {
        swe_set_ephe_path(system.file("ephemeris", package = "swephRdata", mustWork = TRUE))
    } else {
        swe_set_ephe_path(system.file("ephemeris", package = "swephR", mustWork = TRUE))
    }
}

.onUnload <- function (libpath) {
    swe_close()
    library.dynam.unload("swephR", libpath)
}

Try the swephR package in your browser

Any scripts or data that you put into this service are public.

swephR documentation built on May 31, 2023, 5:31 p.m.