r4sub_run_context: Create a Run Context

View source: R/run_context.R

r4sub_run_contextR Documentation

Create a Run Context

Description

A run context captures metadata for a particular evidence collection run. It provides a unique run_id, study identifier, environment label, and timestamps used throughout evidence ingestion.

Usage

r4sub_run_context(
  study_id,
  environment = c("DEV", "UAT", "PROD"),
  user = NULL,
  run_id = NULL,
  timestamp = Sys.time()
)

Arguments

study_id

Character. Study identifier (e.g., "ABC123").

environment

Character. One of "DEV", "UAT", "PROD".

user

Character or NULL. Username; defaults to system user.

run_id

Character or NULL. If NULL, a unique ID is generated.

timestamp

POSIXct. Defaults to current time.

Value

A list of class r4sub_run_context with elements: run_id, study_id, environment, user, created_at.

Examples

ctx <- r4sub_run_context(study_id = "STUDY001", environment = "DEV")
ctx$run_id
ctx$study_id


r4subcore documentation built on Feb. 20, 2026, 5:09 p.m.