-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathREADME.Rmd
More file actions
122 lines (85 loc) · 4.14 KB
/
README.Rmd
File metadata and controls
122 lines (85 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# envsetup <img src='man/figures/logo.png' align="right" height="200" style="float:right; height:200px;" />
<!-- badges: start -->
[](https://CRAN.R-project.org/package=envsetup)
[<img src="http://pharmaverse.org/shields/envsetup.svg">](https://pharmaverse.org)
[](https://github.com/pharmaverse/envsetup/actions/workflows/R-CMD-check.yaml)
[](https://pharmaverse.github.io/envsetup/)
[](https://pharmaverse.github.io/envsetup/_xml_coverage_reports/coverage.html)





[](https://www.repostatus.org/#active)
[](https://github.com/pharmaverse/envsetup/tree/main)
[](https://github.com/pharmaverse/envsetup/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)


<!-- badges: end -->
# 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:
``` yaml
default:
paths:
data: "/path/to/your/data"
output: "/path/to/your/output"
```
## Quick Start Example
```{r eval=FALSE}
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
```{r eval = FALSE}
install.packages("envsetup")
```
### Development version
```{r eval = FALSE}
# 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.