Using envDocument

Donald Jackson (donald.jackson@bms.com)

2017-03-10

The envDocument package provides a function env_doc() which collects information about the environment in which an analysis is run. Currently, this includes:

The primary purpose is to capture information for inclusion in an analysis report. As such, the call to env_doc() should be made after all libraries are attached.

Some functions, especialy getScriptPath() (get path to calling script) and getRepo() (find git repo for calling script), may be useful in other settings.

Examples

library(envDocument) 
library(knitr)


kable(env_doc()) # with git2r installed
kable(env_doc(git = FALSE)) # without git2r

The getScriptPath() function looks up the name of the script being run. If called in an interactive context it will return NA. get_scriptpath() is provided as an alias for backwards compatibility.

env_doc("table")