relibrary: Reloads a package

Description Usage Arguments Details Note Author(s) References See Also

Description

Reloads a package. This function works exactly the same as library, except that it is reloads the package if it already loaded. This is useful for developers. For more information see library. Hadley Wickham has since written the devtools package which has a very similar reload function.

Usage

1
2
  relibrary(package, character.only = FALSE,
    warn.conflicts = TRUE, ...)

Arguments

package

Name or character string giving the name of a package.

character.only

A logical indicating whether package can be assumed to be character strings. Default value is FALSE.

warn.conflicts

If TRUE, warnings are printed about conflicts from reattaching of the package, unless that package contains an object .conflicts.OK. Default value is FALSE.

...

Any other arguments that library accepts.

Details

While relibrary is in the process of reloading a package the options(relibrary) will be set to name of the package currently being reloaded. This can be useful if the package to be reloaded would like save away data until it is loaded again.

As of R 2.12, (and perhaps before) reloading of documentation files doesn't appear to be working. If you change doc files, then for the time being, the whole R session needs restarting.Relibrary does still work OK for updating source code changes.

Note

Reloading packages after making changes to documentation
If you edit an Rd file, rebuild, reinstall & reload the package in an active R session, you will get this error:
Error in fetch(key) : internal error -3 in R_decompress1” I've confirmed with Rdevel (2012-01-27) that it is impossible to work around this error... you have to restart your R session.
Prof Ripley: “This is simply not supported. Lazy-load databases are cached, and you cannot expect to change them during the R session once they have been used.” More info, including 3 suggestions here: http://r.789695.n4.nabble.com/Unable-to-reload-Rdoc-td4333063.html Hadley's devtools::check_Rd function will render an Rd file without having to relaod it.

Author(s)

Henrik Bengtsson, henrikb@braju.com, http://www.braju.com/R/, updated by Mark Cowley.

References

https://stat.ethz.ch/pipermail/r-help/2002-January/018006.html http://r.789695.n4.nabble.com/Unable-to-reload-Rdoc-td4333063.html

See Also

See library unlibrary


drmjc/updateR documentation built on May 15, 2019, 2:41 p.m.