Skip to content
Prev 1792 / 10988 Next

[Rcpp-devel] R.e. Debugging Rcpp packages with GDB

Thanks all for the crash course - it works great!

I just cobbled up a simple "reload" function. This has been a
long-standing pet peeve of mine -- anything that makes me leave the R
shell is distracting.  I've tested it and it seems to work just fine.
Are there any non-obvious downsides here?

reload = function(pkgname, preload=TRUE) {
    ## load it
    if (preload) {
        library(pkgname, character.only = TRUE)
    }
    libs <- dir(paste(.path.package(pkgname), '/libs', sep=''), full.names=TRUE)
    for (lib in libs) {
        dyn.unload(lib)
        dyn.load(lib)
    }
    return()
}

best,
Christian
On Wed, Jan 19, 2011 at 8:01 AM, Dirk Eddelbuettel <edd at debian.org> wrote: