Overview
The envsetup
package helps you manage R project environments by providing a flexible configuration system that adapts to different deployment stages (development, testing, production) without requiring code changes.
Why Use envsetup?
When working on R projects, you often need to:
Point to different data sources across environments
Use different output directories
Load environment-specific functions
Maintain consistent code across environments like dev, qa, and prod
Instead of hardcoding paths or manually changing configurations, envsetup
uses YAML configuration files to manage these differences automatically.
Basic Concepts
The envsetup
package works with two main components:
- PATHS: Manages file system locations (data, output, programs)
- AUTOS: Automatically sources R scripts from specified directories
Installation
Development version
# install.packages("devtools")
devtools::install_github("pharmaverse/envsetup")