list_packages: List Packages Installed in a Conda Environment

View source: R/list_packages.R

list_packagesR Documentation

List Packages Installed in a Conda Environment

Description

This function retrieves a list of all packages installed in the specified Conda environment. The result is returned as a tibble with detailed information about each package, including its name, version, and source details.

Usage

list_packages(env_name = "condathis-env", verbose = "silent")

Arguments

env_name

Character. The name of the Conda environment where the tool will be run. Defaults to "condathis-env". If the specified environment does not exist, it will be created automatically using create_env().

verbose

Character string specifying the verbosity level of the function's output. Acceptable values are:

  • "silent": Suppress all output from internal command-line tools. Equivalent to FALSE.

  • "cmd": Print the internal command(s) passed to the command-line tool.

  • "output": Print the standard output and error from the command-line tool to the screen. Note that the order of the standard output and error lines may not be correct, as standard output is typically buffered. If the standard output and/or error is redirected to a file or they are ignored, they will not be echoed.

  • "full": Print both the internal command(s) ("cmd") and their standard output and error ("output"). Equivalent to TRUE. Logical values FALSE and TRUE are also accepted for backward compatibility but are soft-deprecated. Please use "silent" and "full" respectively instead.

Value

A tibble containing all the packages installed in the specified environment, with the following columns:

base_url

The base URL of the package source.

build_number

The build number of the package.

build_string

The build string describing the package build details.

channel

The channel from which the package was installed.

dist_name

The distribution name of the package.

name

The name of the package.

platform

The platform for which the package is built.

version

The version of the package.

Examples

## Not run: 
condathis::with_sandbox_dir({
  # Creates a Conda environment with the CLI `fastqc`
  condathis::create_env(
    packages = "fastqc",
    env_name = "fastqc-env"
  )
  # Lists the packages in env `fastqc-env`
  dat <- condathis::list_packages("fastqc-env")
  dim(dat)
  #> [1] 34  8
})

## End(Not run)

condathis documentation built on April 12, 2025, 2:01 a.m.