Skip to content
/ envsetup Public

❗ This is a read-only mirror of the CRAN R package repository. envsetup — Support the Setup of the R Environment for Clinical Trial Programming Workflows. Homepage: https://github.com/pharmaverse/envsetup Report bugs for this package: https://github.com/pharmaverse/envsetup/issues

Notifications You must be signed in to change notification settings

cran/envsetup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

envsetup

Check 🛠 Docs 📚 Code Coverage 📔 GitHub commit activity GitHub contributors GitHub last commit GitHub pull requests GitHub repo size Project Status: Active – The project has reached a stable, usable state and is being actively developed. Current Version Open Issues GitHub forks GitHub repo stars

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:

  1. PATHS: Manages file system locations (data, output, programs)
  2. AUTOS: Automatically sources R scripts from specified directories

Your First Configuration

Here’s the simplest possible _envsetup.yml configuration:

default:
  paths:
    data: "/path/to/your/data"
    output: "/path/to/your/output"

Quick Start Example

library(envsetup)

# Load your configuration
envsetup_config <- config::get(file = "_envsetup.yml")

# 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

Installation

install.packages("envsetup")

Development version

# install.packages("devtools")
devtools::install_github("pharmaverse/envsetup")

What’s Next?

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.

About

❗ This is a read-only mirror of the CRAN R package repository. envsetup — Support the Setup of the R Environment for Clinical Trial Programming Workflows. Homepage: https://github.com/pharmaverse/envsetup Report bugs for this package: https://github.com/pharmaverse/envsetup/issues

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages