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.
Note: if the calling script is not tracked in a git repository then
getRepo() will throw warnings. These can be disabled by setting
git = FALSE (see examples).
Version 2.3.1 adds support for Domino Datalab environment reporting. To add this, set
domino = TRUE in the call to
library(envDocument) library(knitr) env_doc() # with git2r installed env_doc("table") # pretty-print output using knitr::kable env_doc(git = FALSE) # without git2r or if script is not trakced. env_doc(domino = TRUE) # optional - print information on Domino Datalab environment
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.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.