The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
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.
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.
The envsetup
package works with two main components:
Here’s the simplest possible _envsetup.yml
configuration:
default:
paths:
data: "/path/to/your/data"
output: "/path/to/your/output"
library(envsetup)
# Load your configuration
<- config::get(file = "_envsetup.yml")
envsetup_config
# Apply the configuration
rprofile(envsetup_config)
# Now you can use the configured paths
print(data) # Points to your data directory
print(output) # Points to your output directory
install.packages("envsetup")
# install.packages("devtools")
::install_github("pharmaverse/envsetup") devtools
In the following guides, you’ll learn:
How to set up basic path configurations
Managing multiple environments
Advanced path resolution
Automatic script sourcing
Real-world examples and best practices
Let’s start with basic path configuration in the next section.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.