MyNixOS website logo
Description

Support the Setup of the R Environment for Clinical Trial Programming Workflows.

The purpose of this package is to support the setup the R environment. The two main features are 'autos', to automatically source files and/or directories into your environment, and 'paths' to consistently set path objects across projects for input and output. Both are implemented using a configuration file to allow easy, custom configurations that can be used for multiple or all projects.

envsetup

Check🛠 Docs📚 Code Coverage📔 GitHub commitactivity GitHubcontributors GitHub lastcommit GitHub pullrequests GitHub reposize Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. CurrentVersion OpenIssues GitHubforks GitHub repostars

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.

Metadata

Version

0.3.0

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows