Skip to contents

Returns a normalized character vector of contextual roots from either:

Usage

context_roots(x)

Arguments

x

Character vector of contextual roots or a named list of contextual definitions.

Value

A normalized character vector of unique contextual roots.

Details

  • a character vector of contextual roots;

  • a named list of contextual definitions.

The function:

  • flattens contextual roots;

  • normalizes filesystem separators;

  • removes trailing separators;

  • validates uniqueness.

This is the public interface for obtaining contextual aggregation boundaries from context definitions.

Examples

mini_context <- list(
  packages = c(
    "D:/packages/examplepkg",
    "C:/packages/examplepkg"
  ),
  research = "D:/research/projectA"
)

context_roots(mini_context)
#> [1] "D:/packages/examplepkg" "C:/packages/examplepkg" "D:/research/projectA"