Learn R Programming

admiraldev

Utility Functions and Development Tools for the Admiral Package Family

Purpose

Functions, tools and documentation for developing core {admiral} and extension package functions. Most functions in {admiraldev} are around testing inputs going into functions. There are also additional quality of life functions to assist developers of {admiral} or {admiral} extension packages, functions to help with rendering documentation, a custom roclet for a better structured documentation, and Developer Guides on developing function and using GitHub, GitHub Actions.

NOTE: This package is not intended for standalone use but rather as a central dependency for {admiral} and its extension packages

Installation

The package is available from CRAN and can be installed by running install.packages("admiraldev").

To install the latest development version of the package directly from GitHub use the following code:

if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}

remotes::install_github("pharmaverse/admiraldev")

Release Schedule

{admiraldev} is to be released to CRAN at the same time as an official release of {admiral}. You can find the release schedule for {admiral} packages here.

Acknowledgments

Along with the authors and contributors, thanks to the following people for their work on the package: Ania Golab, Samia Kabi, Pooja Kumari, Syed Mubasheer, Thomas Neitmann, Ondrej Slama, Kangjie Zhang and Zelos Zhu.

Copy Link

Version

Install

install.packages('admiraldev')

Monthly Downloads

3,143

Version

1.3.1

License

Apache License (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Ben Straub

Last Published

June 25th, 2025

Functions in admiraldev (1.3.1)

assert_one_to_one

Is There a One to One Mapping between Variables?
assert_function

Is Argument a Function?
assert_list_of

Is an Argument a List of Objects of a Specific S3 Class or Type?
assert_filter_cond

Is an Argument a Filter Condition?
assert_list_element

Is an Element of a List of Lists/Classes Fulfilling a Condition?
assert_named

Assert Argument is a Named List or Vector
assert_logical_scalar

Is an Argument a Logical Scalar (Boolean)?
assert_expr_list

Is an Argument a List of Expressions?
assert_integer_scalar

Is an Argument an Integer Scalar?
assert_numeric_vector

Is an Argument a Numeric Vector?
assert_param_does_not_exist

Asserts That a Parameter Does Not Exist in the Dataset
assert_unit

Asserts That a Parameter is Provided in the Expected Unit
capture_message

Captures Messages Preserving the Message Redirection
assert_vars

Is an Argument a List of Variables?
expr_c

Concatenate One or More Expressions
capture_output

Capture Output and Messages
assert_varval_list

Is an Argument a Variable-Value List?
expect_dfs_equal

Expectation: Are Two Datasets Equal?
get_dataset

Retrieve a Dataset from the admiraldev_environment environment
convert_dtm_to_dtc

Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable)
get_duplicates

Get Duplicates From a Vector
get_new_tmp_var

Get a New Temporary Variable Name for a Dataset
backquote

Wrap a String in Backquotes
contains_vars

check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions
filter_if

Optional Filter
dataset_vignette

Output a Dataset in a Vignette in the admiral Format
%notin%

Negated Value Matching
demo_fun

A Demo Function
deprecate_inform

Deprecation with Soft Message
get_source_vars

Get Source Variables from a List of Expressions
dquote

Wrap a String in Double Quotes
extract_vars

Extract All Symbols from a List of Expressions
anti_join

Join Functions
remove_tmp_vars

Remove All Temporary Variables Created Within the Current Function Environment
get_param_tag

Get the content of the @param tag
assert_symbol

Is an Argument a Symbol?
replace_symbol_in_expr

Replace Symbols in an Expression
suppress_warning

Suppress Specific Warnings
transform_examplesx

Transform @caption, @info and @code tags into @examplex tags
assert_same_type

Are All Arguments of the Same Type?
warn_if_vars_exist

Warn If a Variable Already Exists
assert_s3_class

Is an Argument an Object of a Specific S3 Class?
execute_example

Execute Example Code
is_valid_dtc

Is this string a valid DTC
enumerate

Enumerate Multiple Elements
valid_time_units

Valid Time Units
process_set_values_to

Process set_values_to Argument
friendly_type_of

Return English-friendly messaging for object-types
rdx_roclet

Roclet Extending the Standard rd Roclet
get_constant_vars

Get Constant Variables
transform_param

Process @permitted and @default tags
warn_if_inconsistent_list

Warn If Two Lists are Inconsistent
is_order_vars

Is order vars?
replace_values_by_names

Replace Expression Value with Name
parse_code

Parse Code
warn_if_invalid_dtc

Warn If a Vector Contains Unknown Datetime Format
warn_if_incomplete_dtc

Warn if incomplete dtc
squote

Wrap a String in Single Quotes
%or%

Or
vars2chr

Turn a List of Expressions into a Character Vector
what_is_it

What Kind of Object is This?
is_auto

Checks if the argument equals the auto keyword
arg_name

Extract Argument Name from an Expression
assert_expr

Assert Argument is an Expression
assert_character_scalar

Is an Argument a Character Scalar (String)?
assert_character_vector

Is an Argument a Character Vector?
assert_atomic_vector

Is an Argument an Atomic Vector?
assert_data_frame

Is an Argument a Data Frame?
add_suffix_to_vars

Add a Suffix to Variables in a List of Expressions
assert_date_var

Is a Variable in a Dataset a Date or Datetime Variable?
admiraldev-package

admiraldev: Utility Functions and Development Tools for the Admiral Package Family
assert_date_vector

Is an object a date or datetime vector?