ami2

OTHER License

Stars
2
Committers
2

output: github_document

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

ami

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:

install.packages("ami")

If you’d like to try out the development version of ami, you can install directly from GitHub:

# install.packages("remotes")
remotes::install_github("briandconnelly/ami")

Some Examples

Am I online?

ami::online()

Am I using RStudio? Am I using a dark theme?

ami::using_rstudio()

ami::using_rstudio_dark_theme()

Am I using macOS and an Intel Mac?

ami::using_macos() && ami::using_x86_cpu()

Are we running in a Docker container?

ami::using_docker_container()

Are we using a continuous integration service? GitHub Actions?

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 environment:

ami::using_envvar("POETRY_ACTIVE")

We can also check for package options. Here, we'll see whether boot is configured to do parallel bootstrapping using multiple cores:

ami::using_option("boot.parallel", "multicore")

If you're using options as part of package development, check out the options package.

Badges
Extracted from project README
Lifecycle: experimental CRAN status R-CMD-check Codecov test coverage