# sessioncheck The goal of **sessioncheck** is to provide simple tools that can be called at the top of a script, and produce warnings or errors if it detects signs that the script is not being executed in a clean R session. The intended user for **sessioncheck** is a beginner or intermediate level R user who needs a drop-in replacement for the simple but unsafe method of calling `rm(list = ls())` at the top of the script. ## Installation You can install the development version of sessioncheck from [GitHub](https://github.com/) with: ``` r # install.packages("pak") pak::pak("djnavarro/sessioncheck") ``` ## Example The intention when using **sessioncheck** is that you would rarely load it with [`library()`](https://rdrr.io/r/base/library.html). Instead, a single line of code like this would be added at the top of the script: ``` r sessioncheck::sessioncheck() ``` The default behaviour is to check for objects in the global environment and to check packages and environments attached to the search path and produce a warning if issues are detected. This can be converted to an error if a stricter check is required, and additional checks can be added if desired. For details on how the checks work and how they can be customised see the [get started](https://sessioncheck.djnavarro.net/articles/sessioncheck.html) page. # Package index ## Session check Run one or more checks at once - [`sessioncheck()`](https://sessioncheck.djnavarro.net/reference/sessioncheck.md) : Checks the overall status of the R session ## Session checkers Individual session check functions - [`check_globalenv_objects()`](https://sessioncheck.djnavarro.net/reference/check_globalenv_objects.md) : Check global environment objects - [`check_attached_environments()`](https://sessioncheck.djnavarro.net/reference/check_attached_environments.md) : Check environments attached to the search path - [`check_attached_packages()`](https://sessioncheck.djnavarro.net/reference/check_attached_packages.md) : Check attached packages - [`check_loaded_namespaces()`](https://sessioncheck.djnavarro.net/reference/check_loaded_namespaces.md) : Check loaded namespaces - [`check_sessiontime()`](https://sessioncheck.djnavarro.net/reference/check_sessiontime.md) : Check session run time - [`check_required_options()`](https://sessioncheck.djnavarro.net/reference/check_required_options.md) : Check required values for options - [`check_required_locale()`](https://sessioncheck.djnavarro.net/reference/check_required_locale.md) : Check required values for locale settings - [`check_required_sysenv()`](https://sessioncheck.djnavarro.net/reference/check_required_sysenv.md) : Check required values for system environment variables ## Methods S3 methods for session check classes - [`format(`*``*`)`](https://sessioncheck.djnavarro.net/reference/display_methods.md) [`format(`*``*`)`](https://sessioncheck.djnavarro.net/reference/display_methods.md) [`print(`*``*`)`](https://sessioncheck.djnavarro.net/reference/display_methods.md) [`print(`*``*`)`](https://sessioncheck.djnavarro.net/reference/display_methods.md) : Format and print sessioncheck objects - [`as.data.frame(`*``*`)`](https://sessioncheck.djnavarro.net/reference/coercion_methods.md) [`as.data.frame(`*``*`)`](https://sessioncheck.djnavarro.net/reference/coercion_methods.md) : Coerce session check object to a data frame # Articles