{"id":14069093,"url":"https://github.com/rstudio/config","last_synced_at":"2025-05-14T12:12:05.725Z","repository":{"id":37359473,"uuid":"59921890","full_name":"rstudio/config","owner":"rstudio","description":"config package for R","archived":false,"fork":false,"pushed_at":"2025-04-01T12:37:04.000Z","size":8063,"stargazers_count":261,"open_issues_count":18,"forks_count":30,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-24T06:02:15.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rstudio.github.io/config/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rstudio.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-29T01:48:59.000Z","updated_at":"2025-04-03T19:03:05.000Z","dependencies_parsed_at":"2024-03-11T13:44:50.549Z","dependency_job_id":"0227567f-9697-4fe9-98c6-4a499063ec40","html_url":"https://github.com/rstudio/config","commit_stats":{"total_commits":124,"total_committers":10,"mean_commits":12.4,"dds":0.467741935483871,"last_synced_commit":"09d687ebddc05bb58b7919d66b3101f46cd51421"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Fconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Fconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Fconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Fconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rstudio","download_url":"https://codeload.github.com/rstudio/config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254140768,"owners_count":22021220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:06:36.081Z","updated_at":"2025-05-14T12:12:05.698Z","avatar_url":"https://github.com/rstudio.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\nformat: gfm\ndefault-image-extension: \"\"\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\",\n  eval = TRUE\n)\n```\n\n\u003cstyle\u003e\n.codeblock-label {\n  color: #000;\n  display: inline-block;\n  border-top-left-radius: .5rem;\n  border-top-right-radius: .5rem;\n  padding: 0.25rem 0.75rem;\n  background-color: #cccccc;\n  margin-bottom: 0;\n  font-size: 0.875em;\n  font-family: var(--bs-font-monospace);\n}\n  \n.codeblock-label + div.sourceCode {\n  margin-top: 0;\n}\n\u003c/style\u003e\n\n\n```{r child=\"man/fragments/knitr_with_config_hooks.Rmd\", include = FALSE}\n```\n\n# config \u003cimg src='man/figures/logo.svg' align=\"right\" height=\"139\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/config)](https://CRAN.R-project.org/package=config)\n[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/miniCRAN)](https://www.r-pkg.org/pkg/miniCRAN)\n[![R-CMD-check](https://github.com/rstudio/config/workflows/R-CMD-check/badge.svg)](https://github.com/rstudio/config/actions)\n[![Codecov test coverage](https://codecov.io/gh/rstudio/config/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rstudio/config?branch=main)\n\u003c!-- badges: end --\u003e\n\n\nThe `config` package makes it easy to manage environment specific configuration values. For example, you might want to use distinct values for development, testing, and production environments.\n\n## Installation\n\nYou can install the `config` package from CRAN by using:\n\n``` r\ninstall.packages(\"config\")\n```\n\n## Usage\n\nTo use `config`, create a file `config.yml` with default as well as other arbitrary configurations. For example:\n\n\n```{yaml output.var=\"config_yaml\"}\ndefault:\n  trials: 5\n  dataset: \"data-sampled.csv\"\n  \nproduction:\n  trials: 30\n  dataset: \"data.csv\"\n```\n\nTo read configuration values you call the `config::get` function, which returns a list containing all of the values for the currently active configuration:\n\n```{r, with_config=TRUE, config_yml=\"config_yaml\"}\nconfig \u003c- config::get()\nconfig$trials\nconfig$dataset\n```\n\nYou can also read a single value from the configuration as follows:\n\n```{r, with_config=TRUE, config_yml=\"config_yaml\"}\nconfig::get(\"trials\")\nconfig::get(\"dataset\")\n```\n\nThe `config::get()` function takes an optional `config` argument which determines which configuration to read values from (the \"default\" configuration is used if none is specified). \n\n## Vignettes\n\nSee the package vignettes at \u003chttps://rstudio.github.io/config/\u003e for more examples and instructions for advanced usage, including:\n\n- Inheritance and R expressions\n- Using `config` on Posit Connect\n\n\n```{r child=\"man/fragments/no_attach.Rmd\"}\n```\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frstudio%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio%2Fconfig/lists"}