Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/briandconnelly/ami
Checks for Various Computing Environments
https://github.com/briandconnelly/ami
r
Last synced: about 2 months ago
JSON representation
Checks for Various Computing Environments
- Host: GitHub
- URL: https://github.com/briandconnelly/ami
- Owner: briandconnelly
- License: other
- Created: 2022-12-31T23:05:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-14T01:16:45.000Z (3 months ago)
- Last Synced: 2024-11-14T02:19:22.149Z (3 months ago)
- Topics: r
- Language: R
- Homepage: https://briandconnelly.github.io/ami/
- Size: 1.45 MB
- Stars: 17
- Watchers: 3
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - briandconnelly/ami - Checks for Various Computing Environments (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# ami
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/ami)](https://CRAN.R-project.org/package=ami)
[![R-CMD-check](https://github.com/briandconnelly/ami/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/briandconnelly/ami/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/briandconnelly/ami/branch/main/graph/badge.svg)](https://app.codecov.io/gh/briandconnelly/ami?branch=main)ami ("am I?") provides a unified collection of lightweight checks that can be used to better understand the environments in which your code is running.
This includes different operating systems, Continuous Integration (CI) environments, containers, and more.
Similar or identical functions already exist.
However, most of these functions exist within highly specialized packages, so using several of them can quickly create a lot of dependencies for your own projects.## Installation
You can install the latest released version of ami by running:
``` r
install.packages("ami")
```If you’d like to try out the development version of ami, you can install directly from GitHub:
``` r
# install.packages("remotes")
remotes::install_github("briandconnelly/ami")
```## Some Examples
### Am I online?
```{r}
ami::online()
```### Am I using RStudio? Am I using a dark theme?
```{r}
ami::using_rstudio()ami::using_rstudio_dark_theme()
```### Am I using macOS and an Intel Mac?
```{r}
ami::using_macos() && ami::using_x86_cpu()
```### Are we running in a Docker container?
```{r}
ami::using_docker_container()
```### Are we using a continuous integration service? GitHub Actions?
```{r}
ami::using_ci()ami::using_github_actions()
```### Other environments
ami can be used to check any environment variable.
For example, we can see if we're running in a [Poetry](https://python-poetry.org) environment:```{r}
ami::using_envvar("POETRY_ACTIVE")
```We can also check for package options.
Here, we'll see whether [boot](https://cran.r-project.org/package=boot) is configured to do parallel bootstrapping using multiple cores:```{r}
ami::using_option("boot.parallel", "multicore")
```If you're using options as part of package development, check out the [options](https://cran.r-project.org/package=options) package.