Skip to contents

The code_check module stores the packages each code file loads as a comma-joined string in its table$packages column. This returns the sorted, de-duplicated union across a set of those rows — the paper-level dependency list used for the module summary, the manifest code section, and the requirements.txt written into a Psych-DS archive by convert_psychds().

Usage

code_packages(packages)

Arguments

packages

a character vector of comma-joined package strings (e.g. code_check(...)$table$packages), or a code_check table (data frame with a packages column).

Value

a sorted character vector of distinct package names (possibly empty)

Examples

code_packages(c("dplyr, ggplot2", "", "dplyr, tidyr"))
#> [1] "dplyr"   "ggplot2" "tidyr"