Type: Package
Title: Generate Analysis Results Programmes Using ARS Metadata
Version: 0.5.0
Maintainer: Malan Bosman <malanbos@gmail.com>
Description: Analysis Results Standard (ARS), a foundational standard by CDISC (Clinical Data Interchange Standards Consortium), provides a logical data model for metadata describing all components to calculate Analysis Results. https://www.cdisc.org/standards/foundational/analysis-results-standard Using 'siera' package, ARS metadata is ingested (JSON or Excel format), producing programmes to generate Analysis Results Datasets (ARDs).
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.2
Imports: magrittr, dplyr, tibble, tidyr, jsonlite, stringr, readxl, cli
Suggests: knitr, rmarkdown
VignetteBuilder: knitr
URL: https://clymbclinical.github.io/siera/, https://github.com/clymbclinical/siera
BugReports: https://github.com/clymbclinical/siera/issues
NeedsCompilation: no
Packaged: 2025-07-29 15:04:44 UTC; mbosm
Author: Malan Bosman [aut, cre], Clymb Clinical [cph, fnd]
Repository: CRAN
Date/Publication: 2025-07-29 15:30:02 UTC

Pipe operator

Description

See magrittr::%>% for details.

Usage

lhs %>% rhs

Arguments

lhs

A value or the magrittr placeholder.

rhs

A function call using the magrittr semantics.

Value

The result of calling 'rhs(lhs)'.


Get path to example ARD scripts, auto-generated by siera

Description

siera comes bundled with some example ARD-producing scripts in its 'inst/script' directory. This function make them easy to access.

Usage

ARD_script_example(path = NULL)

Arguments

path

Name of R file. If 'NULL', the example files will be listed.

Value

A list of example R files (if path is NULL), or a file itself if path is used.

Examples

ARD_script_example()
ARD_script_example("ARD_Out14-1-1.R")

Get path to ARS example files

Description

siera comes bundled with some example files in its 'inst/extdata' directory. This function make them easy to access.

Usage

ARS_example(path = NULL)

Arguments

path

Name of file. If 'NULL', the example files will be listed.

Value

A list of example files (if path is NULL), or a file itself if path is used.

Examples

ARS_example()
ARS_example("ARS_V1_Common_Safety_Displays.json")

Ingest ARS (Analysis Results Standard) metadata, produce ARD (Analysis Results Dataset) code for each output

Description

Ingest ARS (Analysis Results Standard) metadata, and meta-programme R scripts that could be run as-is to produce Analysis Results Datasets when ingesting ADaM datasets

Usage

readARS(
  ARS_path,
  output_path = tempdir(),
  adam_path = tempdir(),
  spec_output = "",
  spec_analysis = "",
  example = FALSE
)

Arguments

ARS_path

A file containing ARS metadata for a reporting event

output_path

Path to store .R ARD scripts

adam_path

Path to folder containing ADaM datasets, to be run in ARD program

spec_output

The output ID for a specific output to be run from the metadata

spec_analysis

The analysis ID for a specific analysis to be run from the metadata

example

Default is FALSE. If TRUE, example-based operations will be applied to CDISC example ARS. If FALSE, AnalysisMethodCodeTemplateCode will be expected as source of the Method (and Operations) code

Value

R programmes generating ARDs - one for each output (or analysis from an output) specified in the ARS metadata

Examples

# path to file containing ARS metadata

ARS_path <- ARS_example("Common_Safety_Displays_cards.xlsx")

# output path for R programs
output_dir = tempdir()

# folder containing ADaM datasets
adam_folder = tempdir()

# run function, write to temp directory
readARS_xl(ARS_path, output_dir, adam_folder)


Ingest ARS (Analysis Results Standard) metadata, produce ARD (Analysis Results Dataset) code for each output

Description

Ingest ARS (Analysis Results Standard) metadata, and meta-programme R scripts that could be run as-is to produce Analysis Results Datasets when ingesting ADaM datasets

Usage

readARS_xl(
  ARS_path,
  output_path = tempdir(),
  adam_path = tempdir(),
  spec_output = "",
  spec_analysis = "",
  example = FALSE
)

Arguments

ARS_path

A file containing ARS metadata for a reporting event

output_path

Path to store .R ARD scripts

adam_path

Path to folder containing ADaM datasets, to be run in ARD program

spec_output

The output ID for a specific output to be run from the metadata

spec_analysis

The analysis ID for a specific analysis to be run from the metadata

example

Default is FALSE. If TRUE, example-based operations will be applied to CDISC example ARS. If FALSE, AnalysisMethodCodeTemplateCode will be expected as source of the Method (and Operations) code

Value

R programmes generating ARDs - one for each output (or analysis from an output) specified in the ARS metadata

Examples

# path to file containing ARS metadata

ARS_path <- ARS_example("Common_Safety_Displays_cards.xlsx")

# output path for R programs
output_dir = tempdir()

# folder containing ADaM datasets
adam_folder = tempdir()

# run function, write to temp directory
readARS_xl(ARS_path, output_dir, adam_folder)