diff --git a/dev/LICENSE.html b/dev/LICENSE.html index a0071323..0072dd5b 100644 --- a/dev/LICENSE.html +++ b/dev/LICENSE.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/admiraldev.html b/dev/articles/admiraldev.html index d1bcbc76..6defffb5 100644 --- a/dev/articles/admiraldev.html +++ b/dev/articles/admiraldev.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/git_usage.html b/dev/articles/git_usage.html index cc4e3ca1..cfb11856 100644 --- a/dev/articles/git_usage.html +++ b/dev/articles/git_usage.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/index.html b/dev/articles/index.html index 855db96b..3db9d7c5 100644 --- a/dev/articles/index.html +++ b/dev/articles/index.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/package_extensions.html b/dev/articles/package_extensions.html index 8698176c..7d02ad66 100644 --- a/dev/articles/package_extensions.html +++ b/dev/articles/package_extensions.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/pr_review_guidance.html b/dev/articles/pr_review_guidance.html index 95a6f822..4fe400a0 100644 --- a/dev/articles/pr_review_guidance.html +++ b/dev/articles/pr_review_guidance.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/programming_strategy.html b/dev/articles/programming_strategy.html index e21e715f..fe16d948 100644 --- a/dev/articles/programming_strategy.html +++ b/dev/articles/programming_strategy.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/rcmd_issues.html b/dev/articles/rcmd_issues.html index eb5791b3..5ba3b2c1 100644 --- a/dev/articles/rcmd_issues.html +++ b/dev/articles/rcmd_issues.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 @@ -139,7 +139,7 @@ Check Fails Only on One VersionPackage Dependencies > checking package dependencies ... ERROR - Namespace dependency not required: ‘pkg’ + Namespace dependency not required: 'pkg' Add pkg to the Imports or Suggests field in the DESCRIPTION file. In general, dependencies should be listed in the Imports @@ -152,7 +152,7 @@ Package DependenciesGlobal Variables ❯ checking R code for possible problems ... NOTE - function_xyz: no visible binding for global variable ‘some_var’ + function_xyz: no visible binding for global variable 'some_var' Add some_var to the list of “global” variables in R/globals.R. @@ -161,7 +161,7 @@ Undocumented Function Parameter ❯ checking Rd \usage sections ... WARNING Undocumented arguments in documentation object 'function_xyz' - ‘some_param’ + 'some_param' Add an @param some_param section in the header of function_xyz() and run devtools::document() afterwards. diff --git a/dev/articles/release_strategy.html b/dev/articles/release_strategy.html index 81a71ab0..ebea80be 100644 --- a/dev/articles/release_strategy.html +++ b/dev/articles/release_strategy.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/test_data_guidance.html b/dev/articles/test_data_guidance.html index 120bbcf4..226e48a6 100644 --- a/dev/articles/test_data_guidance.html +++ b/dev/articles/test_data_guidance.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/unit_test_guidance.html b/dev/articles/unit_test_guidance.html index 7d49786f..d74297fe 100644 --- a/dev/articles/unit_test_guidance.html +++ b/dev/articles/unit_test_guidance.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/articles/writing_vignettes.html b/dev/articles/writing_vignettes.html index d0b58efb..1bd8bf71 100644 --- a/dev/articles/writing_vignettes.html +++ b/dev/articles/writing_vignettes.html @@ -27,7 +27,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/authors.html b/dev/authors.html index 56170d41..6d3c852d 100644 --- a/dev/authors.html +++ b/dev/authors.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 @@ -110,14 +110,14 @@ Citation Straub B, Bundfuss S, Dickinson J, Farrugia R, Gautier F, Mancini E, Mascary S, Miller G, Sjoberg D, Thoma S, Zhang K, Zhu Z (2025). admiraldev: Utility Functions and Development Tools for the Admiral Package Family. -R package version 1.1.0.9008, +R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/, https://pharmaverse.github.io/admiraldev/. @Manual{, title = {admiraldev: Utility Functions and Development Tools for the Admiral Package Family}, author = {Ben Straub and Stefan Bundfuss and Jeffrey Dickinson and Ross Farrugia and Fanny Gautier and Edoardo Mancini and Sadchla Mascary and Gordon Miller and Daniel Sjoberg and Stefan Thoma and Kangjie Zhang and Zelos Zhu}, year = {2025}, - note = {R package version 1.1.0.9008, + note = {R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/}, url = {https://pharmaverse.github.io/admiraldev/}, } diff --git a/dev/index.html b/dev/index.html index 3ea3bcf3..f1723a2d 100644 --- a/dev/index.html +++ b/dev/index.html @@ -30,7 +30,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/news/index.html b/dev/news/index.html index cf04a98c..e4d73386 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 @@ -48,16 +48,41 @@ admiraldev (development version) New Features + + +Updates of Existing Functions + + +Breaking Changes + +The following function arguments are entering the next phase of the deprecation process: (#2487) (#2595) +Phase 1 (message) +Phase 2 (warning) +Phase 3 (error) +Phase 4 (removed) + + + +Documentation + + +Various + + + +admiraldev 1.2.0 + +New Features New Function deprecate_inform() is a wrapper around lifecycle::deprecate_soft() to allow for more control over messaging. (#466) -Updates of Existing Functions +Updates of Existing Functions Objects passed to assert_list_element() via the ... argument can now be used in the glue expression specified for the message_text argument. (#469) The required_unit argument of assert_unit() has been enhanced. It is now possible to specify more than one unit or not specify it at all. In the latter case only the uniqueness of the unit is checked. (#468) The assert_numeric_vector() function gained an optional length argument to check whether the vector has a specific length. (#473) -Breaking Changes +Breaking Changes admiraldev is only compatible with R version >=4.1 (#456) The following function arguments are entering the next phase of the deprecation process: (#459) @@ -79,11 +104,11 @@ Breaking Changes -Documentation +Documentation Deprecation Strategy updated for the long haul! (#466) -Other +Other devcontainer files removed (#480) diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 42914c8d..a9f78914 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -12,7 +12,7 @@ articles: test_data_guidance: test_data_guidance.html unit_test_guidance: unit_test_guidance.html writing_vignettes: writing_vignettes.html -last_built: 2025-01-15T13:39Z +last_built: 2025-01-15T21:20Z urls: reference: https://pharmaverse.github.io/admiraldev/reference article: https://pharmaverse.github.io/admiraldev/articles diff --git a/dev/reference/add_suffix_to_vars.html b/dev/reference/add_suffix_to_vars.html index 65b8f5a2..b79c3bb6 100644 --- a/dev/reference/add_suffix_to_vars.html +++ b/dev/reference/add_suffix_to_vars.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/admiraldev-package.html b/dev/reference/admiraldev-package.html index 0d1500c8..37591fa7 100644 --- a/dev/reference/admiraldev-package.html +++ b/dev/reference/admiraldev-package.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/arg_name.html b/dev/reference/arg_name.html index 72ff0d9d..2aad84bb 100644 --- a/dev/reference/arg_name.html +++ b/dev/reference/arg_name.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_atomic_vector.html b/dev/reference/assert_atomic_vector.html index 2ba1f15b..6836f8b2 100644 --- a/dev/reference/assert_atomic_vector.html +++ b/dev/reference/assert_atomic_vector.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_character_scalar.html b/dev/reference/assert_character_scalar.html index 3c326e5a..e5486019 100644 --- a/dev/reference/assert_character_scalar.html +++ b/dev/reference/assert_character_scalar.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_character_vector.html b/dev/reference/assert_character_vector.html index 15454eba..fd96a1c9 100644 --- a/dev/reference/assert_character_vector.html +++ b/dev/reference/assert_character_vector.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_data_frame.html b/dev/reference/assert_data_frame.html index 1681b57e..db29c9a2 100644 --- a/dev/reference/assert_data_frame.html +++ b/dev/reference/assert_data_frame.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_date_var.html b/dev/reference/assert_date_var.html index 75adef84..4da2952e 100644 --- a/dev/reference/assert_date_var.html +++ b/dev/reference/assert_date_var.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_date_vector.html b/dev/reference/assert_date_vector.html index 757baa34..ea306ad8 100644 --- a/dev/reference/assert_date_vector.html +++ b/dev/reference/assert_date_vector.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_expr.html b/dev/reference/assert_expr.html index 529e8cc5..049c28d9 100644 --- a/dev/reference/assert_expr.html +++ b/dev/reference/assert_expr.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_expr_list.html b/dev/reference/assert_expr_list.html index 96a73518..ab20861d 100644 --- a/dev/reference/assert_expr_list.html +++ b/dev/reference/assert_expr_list.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_filter_cond.html b/dev/reference/assert_filter_cond.html index 0f848df6..0a1c5f6c 100644 --- a/dev/reference/assert_filter_cond.html +++ b/dev/reference/assert_filter_cond.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_function.html b/dev/reference/assert_function.html index 200d03a1..8fd61709 100644 --- a/dev/reference/assert_function.html +++ b/dev/reference/assert_function.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_integer_scalar.html b/dev/reference/assert_integer_scalar.html index c7f783d1..8a0b6e5a 100644 --- a/dev/reference/assert_integer_scalar.html +++ b/dev/reference/assert_integer_scalar.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_list_element.html b/dev/reference/assert_list_element.html index a069fc25..27b42964 100644 --- a/dev/reference/assert_list_element.html +++ b/dev/reference/assert_list_element.html @@ -11,7 +11,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_list_of.html b/dev/reference/assert_list_of.html index ea73620e..706b8c03 100644 --- a/dev/reference/assert_list_of.html +++ b/dev/reference/assert_list_of.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_logical_scalar.html b/dev/reference/assert_logical_scalar.html index 2476524c..7e59dc0a 100644 --- a/dev/reference/assert_logical_scalar.html +++ b/dev/reference/assert_logical_scalar.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_named.html b/dev/reference/assert_named.html index 54474677..5b5f3622 100644 --- a/dev/reference/assert_named.html +++ b/dev/reference/assert_named.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_numeric_vector.html b/dev/reference/assert_numeric_vector.html index 36f20108..c5297eae 100644 --- a/dev/reference/assert_numeric_vector.html +++ b/dev/reference/assert_numeric_vector.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_one_to_one.html b/dev/reference/assert_one_to_one.html index fe3bd491..b0885d84 100644 --- a/dev/reference/assert_one_to_one.html +++ b/dev/reference/assert_one_to_one.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_param_does_not_exist.html b/dev/reference/assert_param_does_not_exist.html index c5b26d7d..3cea733e 100644 --- a/dev/reference/assert_param_does_not_exist.html +++ b/dev/reference/assert_param_does_not_exist.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_s3_class.html b/dev/reference/assert_s3_class.html index 6e8df4d2..fb2793fc 100644 --- a/dev/reference/assert_s3_class.html +++ b/dev/reference/assert_s3_class.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_same_type.html b/dev/reference/assert_same_type.html index 11f7c075..e037fc7c 100644 --- a/dev/reference/assert_same_type.html +++ b/dev/reference/assert_same_type.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_symbol.html b/dev/reference/assert_symbol.html index 065f70c4..aaa06a9c 100644 --- a/dev/reference/assert_symbol.html +++ b/dev/reference/assert_symbol.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_unit.html b/dev/reference/assert_unit.html index acd96c16..5c4ae5c6 100644 --- a/dev/reference/assert_unit.html +++ b/dev/reference/assert_unit.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_vars.html b/dev/reference/assert_vars.html index b613cb61..e2214a38 100644 --- a/dev/reference/assert_vars.html +++ b/dev/reference/assert_vars.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/assert_varval_list.html b/dev/reference/assert_varval_list.html index 195547d9..b22e56e2 100644 --- a/dev/reference/assert_varval_list.html +++ b/dev/reference/assert_varval_list.html @@ -11,7 +11,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/backquote.html b/dev/reference/backquote.html index 77921cf6..80f1ea5c 100644 --- a/dev/reference/backquote.html +++ b/dev/reference/backquote.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/contains_vars.html b/dev/reference/contains_vars.html index 8c2ab701..2f9d4d31 100644 --- a/dev/reference/contains_vars.html +++ b/dev/reference/contains_vars.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/convert_dtm_to_dtc.html b/dev/reference/convert_dtm_to_dtc.html index d3c182ff..5f37c4a6 100644 --- a/dev/reference/convert_dtm_to_dtc.html +++ b/dev/reference/convert_dtm_to_dtc.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/dataset_vignette.html b/dev/reference/dataset_vignette.html index ded495a6..502fdd68 100644 --- a/dev/reference/dataset_vignette.html +++ b/dev/reference/dataset_vignette.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/deprecate_inform.html b/dev/reference/deprecate_inform.html index 40cb3b95..c4385e2c 100644 --- a/dev/reference/deprecate_inform.html +++ b/dev/reference/deprecate_inform.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/dquote.html b/dev/reference/dquote.html index 05d905d2..44b9233f 100644 --- a/dev/reference/dquote.html +++ b/dev/reference/dquote.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/enumerate.html b/dev/reference/enumerate.html index fada80d4..1ebe00ea 100644 --- a/dev/reference/enumerate.html +++ b/dev/reference/enumerate.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/expect_dfs_equal.html b/dev/reference/expect_dfs_equal.html index bc38b700..b8b66831 100644 --- a/dev/reference/expect_dfs_equal.html +++ b/dev/reference/expect_dfs_equal.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/expr_c.html b/dev/reference/expr_c.html index 685035d3..fd0eb459 100644 --- a/dev/reference/expr_c.html +++ b/dev/reference/expr_c.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/extract_vars.html b/dev/reference/extract_vars.html index b402b863..bd6ba30e 100644 --- a/dev/reference/extract_vars.html +++ b/dev/reference/extract_vars.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/filter_if.html b/dev/reference/filter_if.html index fb7ed3b4..9446f7f6 100644 --- a/dev/reference/filter_if.html +++ b/dev/reference/filter_if.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/friendly_type_of.html b/dev/reference/friendly_type_of.html index 3137d1a6..4302561f 100644 --- a/dev/reference/friendly_type_of.html +++ b/dev/reference/friendly_type_of.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/get_constant_vars.html b/dev/reference/get_constant_vars.html index bad44420..78d93720 100644 --- a/dev/reference/get_constant_vars.html +++ b/dev/reference/get_constant_vars.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/get_dataset.html b/dev/reference/get_dataset.html index 1d6ef965..74726f7a 100644 --- a/dev/reference/get_dataset.html +++ b/dev/reference/get_dataset.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/get_duplicates.html b/dev/reference/get_duplicates.html index cd70207c..f3ea802f 100644 --- a/dev/reference/get_duplicates.html +++ b/dev/reference/get_duplicates.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/get_new_tmp_var.html b/dev/reference/get_new_tmp_var.html index 1b7e1184..201848b8 100644 --- a/dev/reference/get_new_tmp_var.html +++ b/dev/reference/get_new_tmp_var.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/get_source_vars.html b/dev/reference/get_source_vars.html index 586afe35..cdcbeaec 100644 --- a/dev/reference/get_source_vars.html +++ b/dev/reference/get_source_vars.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/grapes-notin-grapes.html b/dev/reference/grapes-notin-grapes.html index ff374c2e..b9bdcdfc 100644 --- a/dev/reference/grapes-notin-grapes.html +++ b/dev/reference/grapes-notin-grapes.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/grapes-or-grapes.html b/dev/reference/grapes-or-grapes.html index 23cd0c12..a2ae9f9d 100644 --- a/dev/reference/grapes-or-grapes.html +++ b/dev/reference/grapes-or-grapes.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/index.html b/dev/reference/index.html index 39ad0c4a..dbdea53d 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/is_auto.html b/dev/reference/is_auto.html index 92368006..7f282c9d 100644 --- a/dev/reference/is_auto.html +++ b/dev/reference/is_auto.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/is_order_vars.html b/dev/reference/is_order_vars.html index f08383cc..47e0d60f 100644 --- a/dev/reference/is_order_vars.html +++ b/dev/reference/is_order_vars.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/is_valid_dtc.html b/dev/reference/is_valid_dtc.html index 250e9c84..2a57cb0f 100644 --- a/dev/reference/is_valid_dtc.html +++ b/dev/reference/is_valid_dtc.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/joins.html b/dev/reference/joins.html index 36af17a6..2b85241e 100644 --- a/dev/reference/joins.html +++ b/dev/reference/joins.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/process_set_values_to.html b/dev/reference/process_set_values_to.html index 1e12e289..27c2c94a 100644 --- a/dev/reference/process_set_values_to.html +++ b/dev/reference/process_set_values_to.html @@ -11,7 +11,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/remove_tmp_vars.html b/dev/reference/remove_tmp_vars.html index 28a56189..a7e6b306 100644 --- a/dev/reference/remove_tmp_vars.html +++ b/dev/reference/remove_tmp_vars.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/replace_symbol_in_expr.html b/dev/reference/replace_symbol_in_expr.html index 2379eb08..ea14ab7e 100644 --- a/dev/reference/replace_symbol_in_expr.html +++ b/dev/reference/replace_symbol_in_expr.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/replace_values_by_names.html b/dev/reference/replace_values_by_names.html index a6cf9814..ff45feb3 100644 --- a/dev/reference/replace_values_by_names.html +++ b/dev/reference/replace_values_by_names.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/squote.html b/dev/reference/squote.html index 9dca3a9a..b92549c5 100644 --- a/dev/reference/squote.html +++ b/dev/reference/squote.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/suppress_warning.html b/dev/reference/suppress_warning.html index dd000064..4bc04736 100644 --- a/dev/reference/suppress_warning.html +++ b/dev/reference/suppress_warning.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/valid_time_units.html b/dev/reference/valid_time_units.html index c165fb7c..c4b07292 100644 --- a/dev/reference/valid_time_units.html +++ b/dev/reference/valid_time_units.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/vars2chr.html b/dev/reference/vars2chr.html index 9e37021e..3a8bce75 100644 --- a/dev/reference/vars2chr.html +++ b/dev/reference/vars2chr.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/warn_if_incomplete_dtc.html b/dev/reference/warn_if_incomplete_dtc.html index 2159e28c..45a6a8e5 100644 --- a/dev/reference/warn_if_incomplete_dtc.html +++ b/dev/reference/warn_if_incomplete_dtc.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/warn_if_inconsistent_list.html b/dev/reference/warn_if_inconsistent_list.html index bbe8873d..99483fae 100644 --- a/dev/reference/warn_if_inconsistent_list.html +++ b/dev/reference/warn_if_inconsistent_list.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/warn_if_invalid_dtc.html b/dev/reference/warn_if_invalid_dtc.html index 71706a72..c775dff6 100644 --- a/dev/reference/warn_if_invalid_dtc.html +++ b/dev/reference/warn_if_invalid_dtc.html @@ -9,7 +9,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/warn_if_vars_exist.html b/dev/reference/warn_if_vars_exist.html index 463ebb21..1a285764 100644 --- a/dev/reference/warn_if_vars_exist.html +++ b/dev/reference/warn_if_vars_exist.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/reference/what_is_it.html b/dev/reference/what_is_it.html index 3c640d44..c3dad95d 100644 --- a/dev/reference/what_is_it.html +++ b/dev/reference/what_is_it.html @@ -7,7 +7,7 @@ admiraldev - 1.1.0.9008 + 1.2.0.9000 diff --git a/dev/search.json b/dev/search.json index c25402bb..e8df8b80 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Version 2.0, January 2004 ","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_1-definitions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"1. Definitions","title":"Apache License","text":"“License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_2-grant-of-copyright-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"2. Grant of Copyright License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_3-grant-of-patent-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"3. Grant of Patent License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_4-redistribution","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"4. Redistribution","title":"Apache License","text":"may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: () must give recipients Work Derivative Works copy License; (b) must cause modified files carry prominent notices stating changed files; (c) must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; (d) Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_5-submission-of-contributions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"5. Submission of Contributions","title":"Apache License","text":"Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_6-trademarks","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"6. Trademarks","title":"Apache License","text":"License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_7-disclaimer-of-warranty","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"7. Disclaimer of Warranty","title":"Apache License","text":"Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_8-limitation-of-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"8. Limitation of Liability","title":"Apache License","text":"event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_9-accepting-warranty-or-additional-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"9. Accepting Warranty or Additional Liability","title":"Apache License","text":"redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"appendix-how-to-apply-the-apache-license-to-your-work","dir":"","previous_headings":"","what":"APPENDIX: How to apply the Apache License to your work","title":"Apache License","text":"apply Apache License work, attach following boilerplate notice, fields enclosed brackets [] replaced identifying information. (Don’t include brackets!) text enclosed appropriate comment syntax file format. also recommend file class name description purpose included “printed page” copyright notice easier identification within third-party archives.","code":"Copyright 2021 F. Hoffmann-La Roche AG and GlaxoSmithKline LLC Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"dear-developers","dir":"Articles","previous_headings":"","what":"Dear Developers","title":"Get Started","text":"admiraldev set tools intended , developer, help make developing within admiral family easier, consistently robust across packages maybe even fun! Tools loosely defined follows: Utility Functions used admiral admiral extension functions custom checks providing custom messages, warnings errors. custom messages, warnings errors succinct, helpful messaging around function expects inputs. inputs admiral functions many, generally fit three categories: datasets, variables arguments. functions start assert_, is_ get_. Utility functions help documentation, testing checking health code base admiral packages. Vignettes working admiral functions, developing unit testing, releases process, vignette writing documentation needs. vignettes intended use across admiral packages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"why-have-a-separate-development-package","dir":"Articles","previous_headings":"","what":"Why have a separate development package?","title":"Get Started","text":"admiral package function base grown decided create extension packages use within companies specific TAs help specific problems. intended extension packages follow processes admiral core, e.g. Unit Testing, Roxygen Documentation, Function Design. standalone development package allows us keep date development process developers across family. also feel lot developer functions user-specific gives us freedom create release utility tools specific family packages reduces non-user facing functions within admiral family packages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"how-to-add-new-tools-to-admiraldev","dir":"Articles","previous_headings":"","what":"How to add new tools to {admiraldev}?","title":"Get Started","text":"Just like admiral, follow procedures adding issues discuss feature requests, bugs documentation updates. develop issues branches Pull Request Code Review. Experimental tools highly encouraged help reduce repetitive patterns automating boring stuff.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"scenario-one-admiral-core","dir":"Articles","previous_headings":"When to add a function to {admiraldev}?","what":"Scenario One: {admiral} core","title":"Get Started","text":"developer working admiral core implements new type derivation function BDS-Findings ADaM dataset. new derivation function two new assert custom checking functions inputs well helper function. Loose guidelines: derivation function always live admiral core. helper function looked see made available within admiraldev extension packages needs reduce repetitive coding across family admiral. generalized, remain admiral. assert custom checking functions always live within admiraldev stay family assertion functions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"scenario-two-admiral-extension","dir":"Articles","previous_headings":"When to add a function to {admiraldev}?","what":"Scenario Two: {admiral} extension","title":"Get Started","text":"developer working admiralonco implements new type derivation function adding certain parameters oncology specific ADaM dataset. new derivation function one new assert custom checking function. Loose guidelines: derivation function closely looked see can generalized ADaM datasets. case, moved admiral core. function specific oncology needs, remain admiralonco. assert custom checking functions follow similar principle - can generalized therapeutic areas move admiraldev, whereas specific oncology needs, remain admiralonco.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Guidance for git and GitHub Usage","text":"article give overview admiral project utilizing version-control software git website GitHub working RStudio. go primary branches house source code admiral project well use Feature branches address Issues. Issues can range bugs enhancements identified requested developers, users testers. also provide bare minimum git commands needed get running. Please refer Resource section -depth guidance using git GitHub.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"branches","dir":"Articles","previous_headings":"","what":"Branches","title":"Guidance for git and GitHub Usage","text":"main branch contains latest development version package. can find released versions gh-pages branches contains code used render R package websites - looking right now! patch branch reserved special hot fixes address bugs rarely used. info Hot Fix Release main, gh-pages, patch branches protection. try push changes branches get error unless administrator. Feature branches actual development related specific issue happens. Feature branches merged main pull request merged. Check Pull Request Review Guidance guidance merging main.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"working-with-feature-branches","dir":"Articles","previous_headings":"","what":"Working with Feature Branches","title":"Guidance for git and GitHub Usage","text":"Feature Branches developers work addressing Issues.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"implementing-an-issue","dir":"Articles","previous_headings":"Working with Feature Branches","what":"Implementing an Issue","title":"Guidance for git and GitHub Usage","text":"feature branch must related issue. encourage new developers work one issue time.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"naming-branches","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Naming Branches","title":"Guidance for git and GitHub Usage","text":"name branch must prefixed issue number, followed short meaningful description. example, given issue #94 “Program function derive LSTALVDT”, branch name 94_derive_var_lstalvdt.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"create-a-new-feature-branch-from-the-terminal-from-main","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Create a New Feature Branch from the Terminal (from main)","title":"Guidance for git and GitHub Usage","text":"Checkout main branch: git checkout main Pull latest changes GitHub: git pull Create new branch main branch switch : git checkout -b ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"create-a-new-feature-branch-from-github-from-main","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Create a New Feature Branch from GitHub (from main)","title":"Guidance for git and GitHub Usage","text":"can also create feature branch GitHub. Switch main branch Type new feature branch name Click Create branch: @main main Sure Pull newly created branch RStudio","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"commits-from-the-terminal-in-rstudio","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Commits from the Terminal in RStudio","title":"Guidance for git and GitHub Usage","text":"start commit process, need tell git move changes staging area. Use git add move changes staging area wait next commit. can use git add . move files worked staging area. Next can commit, takes snapshot staged changes. committing, prefix message issue number add meaningful message git commit –m '#94 last alive date implementation'. Lastly, push changes GitHub using git push origin ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"commits-from-the-git-tab-in-rstudio","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Commits from the Git Tab in RStudio","title":"Guidance for git and GitHub Usage","text":"can also make use Git Tab within RStudio commit changes. benefit using Tab able see changes file red green highlighting. Just like terminal, start message issue number add meaningful succinct sentence. Hit Commit button Push GitHub.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"commit-message-etiquette","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Commit Message Etiquette","title":"Guidance for git and GitHub Usage","text":"require developers insert issue number commit message. Placing issue number commit message allows reviewers quickly find discussion surrounding issue. pushed GitHub issue number hyperlinked issue tracker, powerful tool discussion traceability, think valuable highly regulated industry like Pharma. styles commit messaging permitted:","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"style-1","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Style 1:","title":"Guidance for git and GitHub Usage","text":"feat: #94 skeleton function developed chore: #94 styler lintr update docs: #94 parameters details sections compelted","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"style-2","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Style 2:","title":"Guidance for git and GitHub Usage","text":"#94 skeleton function developed #94 styler lintr update #94 parameters details sections compelted","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"style-3","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Style 3:","title":"Guidance for git and GitHub Usage","text":"skeleton function developed (#94) styler lintr update (#94) parameters details sections compelted (#94)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"pull-request","dir":"Articles","previous_headings":"Working with Feature Branches","what":"Pull request","title":"Guidance for git and GitHub Usage","text":"recommend thorough read articles, Pull Request Review Guidance Programming Strategy -depth discussions proper Pull Request.Pull Request authors benefit shorter review times closely following guidance provided two articles. discuss simple git commands terminal GitHub Pull Request. recommend Pull Request GitHub terminal. changes committed, push updated branch GitHub:git push -u origin GitHub, Pull requests, user either “Compare pull request” button /“Create Pull Request”. first button created GitHub detects recent changes made. branch merge must main branch (base = main) compare branch new branch merge - shown picture. Please pay close attention branch merging ! issue must linked pull request “Development” field Pull Request. cases, linkage automatically close issue move Done column project board. completed Pull Request see committed changes available reviewer. reviewer must specified Pull Request. recommended write brief summary reviewers can quickly come speed Pull Request. Images updates nice , easy GitHub! Use Screen Capture software Copy Paste summary.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"reviewingclosing-an-issue","dir":"Articles","previous_headings":"Working with Feature Branches > Pull request","what":"Reviewing/Closing an Issue","title":"Guidance for git and GitHub Usage","text":"least one reviewer must approve Pull Request. Please review Pull Request Review Guidance, provides depth guidance proper Pull Request. reviewer must ensure function follows programming strategy recommendations. comment/question/discussion must addressed documented GitHub Pull Request merged review completed, reviewer merge Pull Request feature branch automatically deleted. merging Pull Request please check corresponding moved done column Project Board. Also, please make sure issue closed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"solving-merge-conflicts-in-the-terminal-on-rstudio","dir":"Articles","previous_headings":"Working with Feature Branches > Pull request","what":"Solving Merge Conflicts in the Terminal on RStudio","title":"Guidance for git and GitHub Usage","text":"Merge conflict situation git decide changes apply since multiple updates part file. typically happens multiple people update part code. conflicts always need handled manually (code updates may required): provides list files conflicts file conflicts conflicting sections marked <<<<<<<, =======, >>>>>>>. code markers must updated markers removed. Source files need updated manually. Generated files like NAMESPACE generated documentation files updated manually recreated source files updated. make changes available call:","code":"git checkout main git pull git checkout git merge main git add git commit -m \"\" git push"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"solving-merge-conflicts-in-github","dir":"Articles","previous_headings":"Working with Feature Branches > Pull request","what":"Solving Merge Conflicts in GitHub","title":"Guidance for git and GitHub Usage","text":"simple merge conflicts, developers can make use GitHub interface solve . GitHub show number conflicts two branches. image, GitHub found 3 conflicts, display first one. Just like terminal, GitHub make use <<<<<<<, =======, >>>>>>> highlight conflicting sections. need make decision whether keep code base feature branch. decided, go code remove section longer wish keep. sure remove <<<<<<<, =======, >>>>>>> well! work conflicts mark Resolved Commit changes. recommended pull branch back RStudio make sure untoward effects happen branch.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"useful-git-commands","dir":"Articles","previous_headings":"Working with Feature Branches","what":"Useful git Commands","title":"Guidance for git and GitHub Usage","text":"merging: git merge - merge my_branch current branch stashing commands useful one wants go back clean directory git stash - stash (store) current changes restore clean directory git stash pop - put back (restore) stashed changes git revert also helpful ? Using code unmerged branches Checkout unmerged branch want use: git checkout Pull latest committed changes unmerged branch: git pull Check feature branch: git checkout Merge unmerged branch : git merge ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"github_resources","dir":"Articles","previous_headings":"","what":"Resources on using git, GitHub and RStudio","title":"Guidance for git and GitHub Usage","text":"GitHub RStudio Happy Git GitHub useR","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/package_extensions.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Package Extensions","text":"admiral made family packages foresee growing time cover specific areas TA (Therapeutic Area) package extensions, wider range companies individuals getting board join development efforts. step--step guidance talks recommendations new development teams go creating package extensions. critical guidance followed, users need feel consistent experience working across admiral packages. admiral package extension doesn’t follow conventions wouldn’t include pharmaverse part admiral family.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/package_extensions.html","id":"step-by-step-guidance-to-create-a-package-extension","dir":"Articles","previous_headings":"","what":"Step-by-step Guidance to Create a Package Extension","title":"Package Extensions","text":"Note: ordering numbers suggested don’t need strictly followed sequence. Raise need new admiral package extension pharmaverse Slack channel, directly admiral package maintainer. naming convention needs {admiralxxx} request scope targeted overly narrow, example instead package extension HIV ’d prefer one across virology. Otherwise number packages may become unmanageable. agreed, reach company contacts working similar areas see collaborative development can achieved. recommendation always target least 2 companies start implementation remains robust protect going company-specific route. However, consider 4 5 companies get involved early may slow decision-making. companies agree co-develop, identify lead . One company act driver overall package extension put forward product owner technical lead ultimately final say contentious decisions. product owner cover project decisions (e.g. around scope priorities), whereas technical lead cover technical decisions (e.g. around design implementation). technical lead either: ) already significantly involved admiral core development team developer/contributor, b) join core development team simultaneously. ensure design kept true manifesto consistent style quality respect admiral standards. Agree charter expectations company, e.g. usually ask least 3 developers least 25% capacity mix R, GitHub TA experience. Within charter make sure scope timelines clear. important try boil ocean. Focus first common endpoints required foundation package can build via contributions co-development companies also wider across-industry admiral community. useful, admiralonco charter shared guide. company start identify required developer resources. developer required complete {admiral} dummy issue onboarding, well reading admiraldev documentation, - especially developer guides, need followed package extensions. Optionally can useful host kick-meeting decide team work, recommend agile/scrum practices. Set “admiralxxx_dev” channel Slack add team members informal team chat, agree way share working documents across co-development team. recommend use new folder pharmaverse MS Teams - Michael Rimler (michael.s.rimler@gsk.com) help rep PHUSE board. useful starter development activity look pharmaversesdtm check test data sufficient TA needs, e.g. admiralonco generate new test data SDTM domains RS TU. Note personal data used (even anonymized) important keep data generated -line CDISC pilot data use , .e. use USUBJIDs DM etc. Optionally draft, agree sign collaboration agreement collaborating companies wish, useful protecting secondary IP company standard specifications may shared within team. example stored , work Legal teams required. Share company-specific implementations specifications able harmonize design strategy package extension. important remain pragmatic consider higher perspective one company. Engage company standards representatives find discrepancies across company approaches question really need things differently (health authorities patients benefit ?). Also consider always expect level company-specifics covered internal company package extensions. Set new public GitHub repo pharmaverse org using admiraltemplate - includes set-pieces (CI/CD checks issue/PR templates) enable package stay consistent others admiral family, well core package dependencies versions. See {admiraltemplate} Quick Start Guide Note step requires org member access granted pharmaverse council reps, admins org. Also free add additional package dependencies needed assuming reliable packages used, must depend newer versions packages (always reply “” updates suggested installation). repo available technical lead granted admin access repo set GitHub team name package extension assign required access co-development team members. require write access, may choose give leads admin access well never bottle-neck waiting one person. Update template license file repo adding co-development company names place Roche & GSK - admiral package extensions use Apache 2.0, preferred permissive license. Agree co-development companies required extra wording copyright/IP section. Set project board, , help manage backlog. Assuming work agile/scrum, create product backlog, prioritize make sprint plan. intention always re-use much possible admiral core package. find anything additional needed package extension, first question whether might common need TAs consider instead raising issue admiral core. designing new functions always try stay aligned Programming Strategy. Start development foundational first release 0.1.0. Follow consistent Development Process admiral. Line testers companies others set expectations around believe stable version available user testing. can use admiral Slack community raise interest get involved. Add pharmaverse badge README: https://pharmaverse.org/contribute/badges/ - needs support pharmaverse council rep. Raise admiral repo issue ensure package extension site linked core admiral site .` important admiral family packages keep similar release schedule cadence, order ease adoption users give clear expectations. admiral core package cadence releases one every quarter fixed schedule (every first Monday last month quarter - March, June, September, December). core package set release schedule package extensions follow, .e. admiral releases ’d expect package extension releases targeted within 2 week window. releases communicated via Slack channel well quarterly user community meetings. happy package extension well tested sufficient state make submission CRAN. technical lead named maintainer. CRAN release, advertise via Slack & LinkedIn. Plan future enhancements make issues. team feels ready can open development contributions wider community - see page. Please use good first issue (ideal new starters) & help wanted (ideal experienced contributors) issue labels. Note: core admiral team carry periodic reviews extension package contents ensure nothing duplicated ensure standards best practices followed. frequency reviews agreed upon technical leads core extension packages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/package_extensions.html","id":"lessons-learned","dir":"Articles","previous_headings":"","what":"Lessons Learned","title":"Package Extensions","text":"lessons learned previous package extensions: Since ADaM conceived TA-agnostic, TA standards can widely differ across companies, TA package extensions shouldn’t contain many new functions. , functionality required create ADaM present admiral, localized limited exceptions truly TA-specific variables/endpoints. , R folder package extensions relatively lean! Connected , package extension just R functions - also vignettes examples template programs. fact, just important R functions , users turn guidance. Making sure package always --date respect new admiral releases (e.g. due deprecation functions) crucial task. Maintaining package long-term way ensure success. Beware developing just sake developing! may find reach point stasis extension package journey, much need new development. case, vital avoid working tangential tasks. Instead, focus ensuring existing fit--purpose possible.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Pull Request Review Guidance","text":"document intended guidance creators reviewers pull requests (PRs) admiral package family. PR authors benefit shorter review times closely following guidance provided . pull request main branch signifies issue “addressed”. issue might bug, feature request documentation update. Pull Request merged main branch, issue(s) can closed. Closely following guidance ensure “addressed” issues auto-close merge main.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"review-criteria","dir":"Articles","previous_headings":"","what":"Review Criteria","title":"Pull Request Review Guidance","text":"pull request merged main needs pass automated CI checks appear bottom Pull Request. addition, PR creator reviewer make sure Programming Strategy Development Process followed function ADaM IG compliant function intended (described header corresponding issue) function header properly explains intention function, expected inputs (incl. permitted values parameters) output produced; reading documentation reader able predict output function without read source code function accompanying set unit tests; derivations unit test code coverage least 90%; whole package coverage >= 80% implemented derivation scope admiral, e.g. expect company specific input hard-code company-specific rules meaningful error warning messages issued input invalid documentation created/updated running devtools::document() functions supposed exported listed NAMESPACE file; requires @export tag function header examples print relevant source variables newly created variables /records output NEWS.md file updated entry explains new features changes change user-specific warrants mention development milestone files affected implemented changes, e.g. vignettes templates, updated","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"codeowners-and-pr-guidance","dir":"Articles","previous_headings":"Review Criteria","what":"Codeowners and PR Guidance","title":"Pull Request Review Guidance","text":"creator PR, assignment reviewer can unclear. PRs, feel free select members core development team. individuals scan repository regular basis well may provide /review even originally included selected reviewer. Sometimes, development function vignette falls specific-topic, e.g. labs PK/PD. Please ensure include appropriate reviewer modifying files rely domain-expertise. try maintain active list domain-specific topics automatically tag appropriate reviewer using CODEOWNERS file, located .github folder. interested codeowner, reach development team.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"so-much-red-tape","dir":"Articles","previous_headings":"","what":"So much Red Tape!","title":"Pull Request Review Guidance","text":"admiral development team aware sympathetic great many checks, processes documents needed work order compliant Pull Request. task-list-completed GitHub workflow created help reduce burden contributors providing standardized checklist compiles information Pull Request Review Guidance, Programming Strategy Development Process vignettes. next three sections give high-level overview contributor faces opening PR, contributor interacts task-list-completed workflow PR.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"open-a-pull-request","dir":"Articles","previous_headings":"So much Red Tape!","what":"Open a Pull Request","title":"Pull Request Review Guidance","text":"contributor opens PR lengthy standard text inserted comment section. Please alter automated text. need manually add Closes # title Pull Request. can use Edit button top right forget step start Pull Request. Besides free add additional textual information, screenshots, etc. bottom automated text needed clarify contribute discussion around PR.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"create-a-pull-request","dir":"Articles","previous_headings":"So much Red Tape!","what":"Create a Pull Request","title":"Pull Request Review Guidance","text":"click green Create pull request button automated text inserted turned checklist Pull Request. check box drawn previously mentioned vignettes presented recommended sequence. check boxes meant helpful aid ensuring created compliant Pull Request.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"complete-the-pull-request-checklist","dir":"Articles","previous_headings":"So much Red Tape!","what":"Complete the Pull Request checklist","title":"Pull Request Review Guidance","text":"check boxes linked task-list-completed workflow. need check box acknowledgment done due diligence creating compliant Pull Request. GitHub refresh Pull Request trigger task-list-completed workflow completed task. PR can merged main contributor checked check box items. Please don’t hesitate reach admiral team Slack GitHub Issues tracker think checklist needs amended clarity needed check box item. Note Reviewers: recommend use Squash Merge merging Pull Request. create clean commit history.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"github-actionsci-workflows","dir":"Articles","previous_headings":"","what":"GitHub Actions/CI Workflows","title":"Pull Request Review Guidance","text":"task-list-completed workflow one several workflows/actions used within admiral. workflows live .github/workflows folder important understand use remedy workflow fails. Workflows defined responsible assuring high package quality standards without compromising performance, security, reproducibility.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"a-synopsis-of-admirals-workflows","dir":"Articles","previous_headings":"GitHub Actions/CI Workflows","what":"A synopsis of admiral’s workflows","title":"Pull Request Review Guidance","text":"recommend checking README admiralci repository gain understanding workflows/actions used admiral.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Programming Strategy","text":"admiral intended contributed user community, article meant developers want either expand admiral functionalities build top admiral. order keep framework robust across whole community, defined programming strategy followed cases. contributions include, example, company specific derivations ADaM datasets.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"functional-workflow","dir":"Articles","previous_headings":"","what":"Functional Workflow","title":"Programming Strategy","text":"Overall programming follow functional approach. mandate use tidyverse (e.g. dplyr) similar functionality existing base R ADaM dataset built set functions free flow code. ADaM dataset specific programming workflow. function specific purpose supports ADaM Dataset programming workflow. admiral function company specific function. Admiral functions can re-used company specific functions. function belongs one category defined keywords/family. function used derive one multiple variable(s) required unit tested. Functions standard naming convention. Double coding used QC method (absolutely necessary). ADaMs created readable, submission-ready code.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-design","dir":"Articles","previous_headings":"Functions in R","what":"Function Design","title":"Programming Strategy","text":"Firstly, important explain decide need new derivation functions. derivation rule algorithm common highly similar across different variables/parameters (e.g. study day duration) provide generic function can used satisfy times may needed across different ADaMs. Similarly, feel certain derivation useful beyond single purpose also provide generic function (e.g. instead last known alive date function, extreme date function user find last date selection, example first). Otherwise, feel derivation rule unique need sufficiently complex justify opt dedicated function specific variable/parameter (e.g. treatment-emergent flag AEs). certain variables closely connected (e.g. imputed date corresponding imputation flag) single function provide variables. something needed ADaM achieved simply via existing tidyverse function, wrap admiral function, add unnecessary extra layer users. following principles key designing new function: Modularity - code follows modular approach, .e. steps must clearly separated dedicated purpose. applies scripts creating dataset module create single variable parameter. also complex derivations several steps. Commenting steps key readability. Avoid Copy Paste - similar code used multiple times, put separate function. improves readability maintainability makes unit testing easier. done every simple programming step tidyverse can used. rather computational functions data checks. However, also consider nest many functions. Checks - Whenever function fails, meaningful error message must provided clear reference input caused failure. users dig detailed code want apply function. meaningful error message supports usability. Flexibility - Functions flexible possible long reduce usability. example: source variables newly created variables conditions selecting observations hard-coded. useful argument triggers optional steps, e.g. filter argument specified, input dataset restricted, otherwise step skipped. However, arguments trigger completely different algorithms. example BNRIND derived based BASE based ANRIND. implemented within one function algorithms completely different. BASE used, values categorized ANRIND used, values merged baseline observation.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"input-output-and-side-effects","dir":"Articles","previous_headings":"Functions in R","what":"Input, Output, and Side-effects","title":"Programming Strategy","text":"behavior function determined input, global object, .e. input like datasets, variable names, options, … must provided function arguments. expected input datasets grouped. grouped, function must issue error. function requires grouping, function must provide by_vars argument. output dataset must ungrouped. functions sort (arrange) output dataset end. function needs create temporary variables input dataset, names variables must generated get_new_tmp_var() avoid variables input dataset accidentally overwritten. temporary variables must removed output dataset calling remove_tmp_vars(). developers find need use create environment objects achieve flexibility, use admiral_environment environment object created admiral_environment.R. objects stored environment must documented admiral_environment.R. equivalent environment object .R file exist admiraldev well. details environments work, see relevant sections environments R Packages Advanced R textbooks. general, function must side-effects like creating modifying global objects, printing, writing files, …","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"admiral-options","dir":"Articles","previous_headings":"Functions in R","what":"Admiral Options","title":"Programming Strategy","text":"exception made admiral options, see get_admiral_option() set_admiral_options(), certain pre-defined defaults added flexibility allow user-defined defaults commonly used function arguments e.g. subject_keys currently pre-defined exprs(STUDYID, USUBJID), can modified using set_admiral_options(subject_keys = exprs(...)) top script. reasoning behind relieve user repeatedly changing aforementioned commonly used function arguments multiple times script, may called across many admiral functions. additional flexibility needs added another commonly used function argument e.g. future_input set exprs(...) can added admiral option. function formals define future_input = get_admiral_option(\"future_input\") proceed modify body roxygen documentation set_admiral_options().","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-names","dir":"Articles","previous_headings":"Functions in R","what":"Function Names","title":"Programming Strategy","text":"Function names start verb use snake case, e.g. derive_var_base(). Please note appropriate var/vars prefix used cases function creates variable(s), regardless presence new_var argument function call. Oftentimes creating new derive_var derive_param function may sort non-trivial calculation involved may want write customized function . creating compute_ function becomes appropriate, calculation portion contained one step part overall derive_ function, reducing clutter main function body assisting debugging. addition, compute_ function implemented calculation used one derivation. example compute_bmi() used derive baseline BMI variable ADSL (based baseline weight baseline height variables) also used derive BMI parameter ADVS (based weight height parameters). Please see compute_age_years() derive_var_age_years() another example.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-arguments","dir":"Articles","previous_headings":"Functions in R","what":"Function Arguments","title":"Programming Strategy","text":"default value optional arguments NULL. recommended argument order contributors asked adhere (order keep consistency across functions): dataset (additional datasets denoted dataset_*) by_vars order new_var (related new_var_* arguments) filter (additional filters denoted filter_*) Make sure always mention start_date end_date (related). Names variables inside dataset passed symbols rather strings, .e. AVAL rather \"AVAL\". argument accepts one variables expressions input variables expressions wrapped inside exprs(). example: new_var = TEMPBL by_vars = exprs(PARAMCD, AVISIT) filter = PARAMCD == \"TEMP\" order = exprs(AVISIT, desc(AESEV)) new_vars = exprs(LDOSE = EXDOSE, LDOSEDT = convert_dtc_to_dt(EXSTDTC)) function argument needs tested assert_ type function. expression needs tested following (many utility functions admiral available contributor): whether expression (list expressions, depending function) whether valid expression (.e. whether evaluates without error)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"common-function-arguments-naming-convention","dir":"Articles","previous_headings":"Functions in R","what":"Common Function Arguments Naming Convention","title":"Programming Strategy","text":"first argument derive_ functions input dataset named dataset. one input dataset required, input dataset start dataset_, e.g., dataset_ex. Arguments specifying items add start new_. variable added, second part argument name var, parameter added, param. example: new_var, new_var_unit, new_param. Arguments expect boolean boolean vector must start verb, e.g., is_imputed impute_date. Arguments expect one value variable name must singular version word(s), e.g., missing_value new_var. Arguments expect several values variable names (list, expressions, etc.) must plural version word(s), e.g., missing_values new_vars.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"source-code-formatting","dir":"Articles","previous_headings":"Functions in R","what":"Source Code Formatting","title":"Programming Strategy","text":"source code formatted according tidyverse style guide. lintr styler packages used check enforce .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"comments","dir":"Articles","previous_headings":"Functions in R","what":"Comments","title":"Programming Strategy","text":"Comments added help readers author understand code. two main cases: intention chunk code clear, comment added. comment rephrase code provide additional information. Bad Good long functions (>100 lines) comments can added structure code simplify navigation. case comment end ---- add entry document outline RStudio. example: formatting comments must follow tidyverse style guide. .e., comment start single # space. decoration (except outline entries) must added. Bad Good","code":"# If AVAL equals zero, set it to 0.0001. Otherwise, do not change it mutate(dataset, AVAL = if_else(AVAL == 0, 0.0001, AVAL)) # AVAL is to be displayed on a logarithmic scale. # Thus replace zeros by a small value to avoid gaps. mutate(dataset, AVAL = if_else(AVAL == 0, 0.0001, AVAL)) # Check arguments ---- # This is a comment # ########################### # This is another comment # ########################### #+++++++++++++++++++++++++++++++ # This is a section comment ---- #+++++++++++++++++++++++++++++++ # This is a comment # This is another comment # This is a section comment ----"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"input-checking","dir":"Articles","previous_headings":"Functions in R","what":"Input Checking","title":"Programming Strategy","text":"line fail-fast design principle, function inputs checked validity , ’s invalid input, function stop immediately error. exception case variable added function already exists input dataset: warning displayed function continue executing. Inputs checked using custom assertion functions defined R/assertions.R. custom assertion functions either return error case invalid input return nothing. common types input arguments like single variable, list variables, dataset, … functions checking available (see assertions). Arguments expect keywords handle case-insensitive manner, e.g., date_imputation = \"FIRST\" date_imputation = \"first\" accepted. assert_character_scalar() function helps handling arguments case-insensitive manner. argument checked outer function argument name inner function. rule applicable functions part admiral.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-header-documentation","dir":"Articles","previous_headings":"Functions in R","what":"Function Header (Documentation)","title":"Programming Strategy","text":"Every function exported package must accompanying header formatted according roxygen2 convention. addition standard roxygen2 tags, @family @keywords tags also used. family/keywords used categorize function, used website internal package help pages. Please see section Categorization functions. example given : following fields mandatory: @param: One entry per function argument. following attributes described: expected data type (e.g. data.frame, logical, numeric etc.), permitted values (applicable), optionality (.e. required argument). expected input dataset required variables clearly stated. Describing default value becomes difficult maintain subject manual error already declared function arguments. description permitted values written separate line italicizing phrase “Permitted Values”, example : @details: natural-language description derivation used inside function. @keyword: One applicable tag function - identical family. @family: One applicable tag function - identical keyword. @return: description return value function. newly added variable(-s) mentioned . @examples: fully self-contained example use function. Self-contained means , code executed new R session, run without errors. means packages need loaded library() datasets needed either created directly inside example code loaded using data(). dataset created example, done using function tribble() (specify library(dplyr) calling function). functions called example, please specify library(pkg_name) refer respective function fun() opposed preferred pkg_name::fun() notation specified Unit Test Guidance. Make sure align columns ensures quick code readability. Copying descriptions avoided makes documentation hard maintain. example argument description used one function, argument described one function functions use @inheritParams . Please note @inheritParams func_first used header func_second() function, argument descriptions func_first() included documentation func_second() argument offered func_second() @param tag argument included header func_second(). order @param tags function definition. @inheritParams tags @param. affect order argument description rendered documentation makes easier maintain headers. Variable names, expressions, functions, code must enclosed backticks. render code. functions derive specific CDISC variable, title must state label variable without variable name. variable stated description.","code":"#' Derive Relative Day Variables #' #' Adds relative day variables (`--DY`) to the dataset, e.g., `ASTDY` and #' `AENDY`. #' #' @param dataset Input dataset #' #' The columns specified by the `reference_date` and the `source_vars` #' argument are expected. #' #' @param reference_date The start date column, e.g., date of first treatment #' #' A date or date-time object column is expected. #' #' Refer to `derive_var_dt()` to impute and derive a date from a date #' character vector to a date object. #' #' @param source_vars A list of datetime or date variables created using #' `exprs()` from which dates are to be extracted. This can either be a list of #' date(time) variables or named `--DY` variables and corresponding --DT(M) #' variables e.g. `exprs(TRTSDTM, ASTDTM, AENDT)` or `exprs(TRTSDT, ASTDTM, #' AENDT, DEATHDY = DTHDT)`. If the source variable does not end in --DT(M), a #' name for the resulting `--DY` variable must be provided. #' #' @details The relative day is derived as number of days from the reference #' date to the end date. If it is nonnegative, one is added. I.e., the #' relative day of the reference date is 1. Unless a name is explicitly #' specified, the name of the resulting relative day variable is generated #' from the source variable name by replacing DT (or DTM as appropriate) with #' DY. #' #' @return The input dataset with `--DY` corresponding to the `--DTM` or `--DT` #' source variable(s) added #' #' @keywords der_date_time #' @family der_date_time #' #' @export #' #' @examples #' library(lubridate) #' library(dplyr, warn.conflicts = FALSE) #' #' datain <- tribble( #' ~TRTSDTM, ~ASTDTM, ~AENDT, #' \"2014-01-17T23:59:59\", \"2014-01-18T13:09:O9\", \"2014-01-20\" #' ) %>% #' mutate( #' TRTSDTM = as_datetime(TRTSDTM), #' ASTDTM = as_datetime(ASTDTM), #' AENDT = ymd(AENDT) #' ) #' #' derive_vars_dy( #' datain, #' reference_date = TRTSDTM, #' source_vars = exprs(TRTSDTM, ASTDTM, AENDT) #' ) #' *Permitted Values*: example description of permitted values here"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"categorization-of-functions","dir":"Articles","previous_headings":"Functions in R","what":"Categorization of Functions","title":"Programming Strategy","text":"functions categorized keywords families within roxygen header. Categorization important admiral user-facing functions base totals 125 growing! However, ease burden developers, decided keywords families identical roxygen header, specified via @keywords @family fields. reiterate, function must use keyword family. Also, please note keywords families case-sensitive.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"keywords","dir":"Articles","previous_headings":"Functions in R > Categorization of Functions","what":"@keywords","title":"Programming Strategy","text":"keywords allows reference page easily organized using certain pgkdown functions. example, using function has_keyword(der_bds_gen) _pkgdown.yml file building website collect BDS General Derivation functions display alphabetical order Reference Page section called BDS-Specific.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"family","dir":"Articles","previous_headings":"Functions in R > Categorization of Functions","what":"@family","title":"Programming Strategy","text":"families allow similar functions displayed See Also section function’s documentation. example, user looking derive_vars_dy() function documentation might interested Date/Time functions. Using @family tag der_date_time display Date/Time functions available admiral user See Also section derive_vars_dy() function documentation. Please take look function documentation derive_vars_dy() see family tag action. list available keyword/family tags used admiral functions. think additional keyword/family tag added, please add issue GitHub discussion. NOTE: strongly encouraged @keyword @family identical. eases burden development maintenance admiral functions. need use multiple keywords families, please reach core development team discussion.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"missing-values","dir":"Articles","previous_headings":"","what":"Missing values","title":"Programming Strategy","text":"Missing values (NAs) need explicitly shown. Regarding character vectors converted SAS files: SAS treats missing character values blank. imported R empty strings (\"\") although nature missing values (NA). empty strings originate like need converted proper R missing values NA.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"file-structuring","dir":"Articles","previous_headings":"","what":"File Structuring","title":"Programming Strategy","text":"Organizing functions files art science. Thus, hard rules just recommendations. First foremost, two extremes avoided: putting function file putting functions single file. Apart following recommendations taken consideration deciding upon file structuring: function long (together documentation), store separate file functions documented together, put one file functions sort commonality relevance one another (like dplyr::bind_rows() dplyr::bind_cols()), put one file Store functions together helpers methods 1000 lines single file, unless necessary (exceptions , example, classes methods) responsibility author new function reviewer ensure recommendations put practice.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"r-package-dependencies","dir":"Articles","previous_headings":"","what":"R Package Dependencies","title":"Programming Strategy","text":"Package dependencies documented DESCRIPTION file. package used examples /unit tests listed Suggests, otherwise Imports. Functions packages explicitly imported using @importFrom tag R/admiral-package.R file. import if_else() mutate() function dplyr following line included file: #' @importFrom dplyr if_else mutate. using @importFrom tag, easier track dependencies one place improves code readability. functions become critically important using admiral included export. applies functions frequently called within {admiral }function calls like rlang::exprs(), dplyr::desc() pipe operator dplyr::%>%. export functions, following R code included R/reexports.R file using format:","code":"#' @export pkg_name::fun"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"metadata","dir":"Articles","previous_headings":"","what":"Metadata","title":"Programming Strategy","text":"Functions perform derivation logic add kind metadata, e.g. labels.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"unit-testing","dir":"Articles","previous_headings":"","what":"Unit Testing","title":"Programming Strategy","text":"function requires set unit tests verify produces expected result. See Writing Unit Tests {admiral} details.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"deprecation","dir":"Articles","previous_headings":"","what":"Deprecation","title":"Programming Strategy","text":"deprecation strategy provides stability users allowing admiral developers ability remove update code base coming days. Phase 1: release identified function argument deprecated, message issued using function argument using deprecate_inform(). message appear user least one year. Templates, vignettes internal calls updated use new recommended function/argument. Phase 2: least one year closet next release, warning issued using function argument using deprecate_warn(). warning message appear least one year. Phase 3: least one year closest next release, error thrown using function argument using deprecate_stop() follow similar process Phase 1 Phase 2. Phase 4: Finally three years time identified deprecation, function argument completely removed admiral. NB: Major/Minor release make sense deprecation updates. However, release cycle becomes multiple years, patch releases considered help keep admiral neat tidy! NB: Take care NEWS.md entries around deprecation person continuing process might !","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"documentation","dir":"Articles","previous_headings":"Deprecation","what":"Documentation","title":"Programming Strategy","text":"function argument removed, documentation must updated indicate function argument now deprecated new function/argument used instead. documentation updated Phase 1: description level function lifecycle badge added, @keywords @family roxygen tags replaced deprecated Example documentation argument level @param level argument. documentation updated Phase 3: @examples section removed.","code":"#' Title of the function #' #' @description #' `r lifecycle::badge(\"deprecated\")` #' #' This function is *deprecated*, please use `new_fun()` instead. #' . #' @family deprecated #' @keywords deprecated @param old_param `r lifecycle::badge(\"deprecated\")` Please use `new_param` instead."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"handling-of-messages-warnings-and-errors","dir":"Articles","previous_headings":"Deprecation","what":"Handling of Messages, Warnings and Errors","title":"Programming Strategy","text":"function argument deprecated, function must updated issue message, warning error using deprecate_inform(), deprecate_warn() deprecate_stop(), respectively, described . test case added test file function checks whether message/warning/error issued appropriate using deprecated function argument.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function","dir":"Articles","previous_headings":"Deprecation > Handling of Messages, Warnings and Errors","what":"Function","title":"Programming Strategy","text":"Phase 1: start phase call deprecate_inform() appear : NB: Please adjust phrase {beginning 20XX} relevant timeline. code deprecated function replaced call new function used instead. Phase 2: start phase call deprecate_warn() appear : NB: Please adjust phrase {beginning 20XX} relevant timeline. Phase 3: start phase call deprecate_stop() appear : Phase 4: Function removed package.","code":"fun_xxx <- function(dataset, some_param, other_param) { deprecate_inform( when = \"x.y.z\", what = \"fun_xxx()\", with = \"new_fun_xxx()\", details = c( x = \"This message will turn into a warning {at the beginning of 20XX}.\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) ) new_fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param ) } fun_xxx <- function(dataset, some_param, other_param) { deprecate_warn( when = \"x.y.z\", what = \"fun_xxx()\", with = \"new_fun_xxx()\", details = c( x = \"This message will turn into a error {at the beginning of 20XX}.\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) ) new_fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param ) } fun_xxx <- function(dataset, some_param, other_param) { deprecate_stop( when = \"x.y.z\", what = \"fun_xxx()\", with = \"new_fun_xxx()\" ) new_fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param ) }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"argument","dir":"Articles","previous_headings":"Deprecation > Handling of Messages, Warnings and Errors","what":"Argument","title":"Programming Strategy","text":"Phase 1: argument renamed replaced, message must issued new argument takes value old argument next phase. Note: arguments passed exprs() argument (e.g. new_var = VAR1 filter = AVAL > 10) need quoted. Phase 2: argument renamed replaced, warning must issued new argument takes value old argument next phase Note: arguments passed exprs() argument (e.g. new_var = VAR1 filter = AVAL > 10) need quoted. Phase 3: argument removed replaced, error must generated: Phase 4: mentions argument completely removed admiral.","code":"if (!missing(old_param)) { deprecate_inform(\"x.y.z\", \"fun_xxx(old_param = )\", \"fun_xxx(new_param = )\") # old_param is given using exprs() new_param <- old_param # old_param is NOT given using exprs() new_param <- enexpr(old_param) } if (!missing(old_param)) { deprecate_warn(\"x.y.z\", \"fun_xxx(old_param = )\", \"fun_xxx(new_param = )\") # old_param is given using exprs() new_param <- old_param # old_param is NOT given using exprs() new_param <- enexpr(old_param) } if (!missing(old_param)) { deprecate_stop(\"x.y.z\", \"fun_xxx(old_param = )\", \"fun_xxx(new_param = )\") }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"unit-testing-1","dir":"Articles","previous_headings":"Deprecation","what":"Unit Testing","title":"Programming Strategy","text":"Unit tests deprecated functions arguments must added test file 1 function ensure message, warning, error issued. unit-test follow corresponding format, per unit test guidance.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"for-deprecated-functions-that-issue-a-message-phase-1","dir":"Articles","previous_headings":"Deprecation > Unit Testing","what":"For Deprecated Functions that Issue a Message (Phase 1)","title":"Programming Strategy","text":"Please put tests deprecation top test file make finding specific test easier next phase deprecation. Tests call multiple functions deprecation messages can wrapped using parentheses curly brackets, e.g. expect_snapshot({}). can use withr::local_options(list(lifecycle_verbosity = \"quiet\")) suppress deprecation messages already created tests.","code":"## Test 1: deprecation message if function is called ---- test_that(\"derive_var_example() Test #: deprecation message if function is called\", { expect_snapshot({ ae <- date_source(...) ... derive_var_example(...) }) }) ## Test 2: Test of function argument 1 ---- test_that(\"derive_var_example() Test 2: Test of function argument 1\", { withr::local_options(list(lifecycle_verbosity = \"quiet\")) ... })"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"for-deprecated-functions-that-issue-a-warning-phase-2","dir":"Articles","previous_headings":"Deprecation > Unit Testing","what":"For Deprecated Functions that Issue a Warning (Phase 2)","title":"Programming Strategy","text":"snapshot deprecation message test must updated instead message warning issued now.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"for-deprecated-functions-that-issue-an-error-phase-3","dir":"Articles","previous_headings":"Deprecation > Unit Testing","what":"For Deprecated Functions that Issue an Error (Phase 3)","title":"Programming Strategy","text":"unit test like following must added. writing unit test, check error right class, .e., \"lifecycle_error_deprecated\". unit tests deprecated function must removed.","code":"## Test #: error if function is called ---- test_that(\"derive_var_example() Test #: deprecation error if function is called\", { expect_error( derive_var_example(), class = \"lifecycle_error_deprecated\" ) })"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"best-practices-and-hints","dir":"Articles","previous_headings":"","what":"Best Practices and Hints","title":"Programming Strategy","text":"Please take following list recommendation try adhere rules possible. Arguments function calls named except first parameter (e.g. assert_data_frame(dataset, required_vars = exprs(var1, var2), optional = TRUE)). dplyr::if_else() used two conditions. Try always set missing argument whenever appropriate.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"how-quoting-is-used","dir":"Articles","previous_headings":"Best Practices and Hints","what":"How Quoting is used","title":"Programming Strategy","text":"admiral arguments require selecting one particular option like mode, e.g. mode = \"last\". Use quotation marks capture . expected assertion function corresponding arguments assert_character_scalar()/assert_character_vector(). Many admiral arguments require capturing expression, typically encased exprs() statement, evaluated later inside function body, see arguments like new_vars, e.g. new_vars = exprs(TRTSDTM = EXSTDTM). Oftentimes, assertion function corresponding assert_expr()/assert_expr_list(). arguments unquoted using !!!. admiral arguments like new_var filter expect single variable expression quoted call. function body, quoted using enexpr(). Usually combined assertion, e.g., new_var <- assert_symbol(enexpr(new_var)). arguments unquoted using !!. Keep mind !! one--one replacement !!! one--many replacement. Please see chapter Advanced R textbook details.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"standardizing-text-used-to-label-and-describe-arguments","dir":"Articles","previous_headings":"Best Practices and Hints","what":"Standardizing Text Used to Label and Describe Arguments","title":"Programming Strategy","text":"following PR, find example function argument dataset able standardized Label Description said function argument aligned across codebase. Please see changes file derive_adeg_params.R details. benefits programmatic way write documentation changes need made, making modification corresponding function, case, roxygen_param_dataset(), scales across codebase, can tested, less prone user-error typos grammar mistakes. functions implemented roxygen2.R naming convention argument follows roxygen_param_xxx(), “xxx” replaced argument name.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"r-and-package-versions-for-development","dir":"Articles","previous_headings":"","what":"R and Package Versions for Development","title":"Programming Strategy","text":"choice R Version Package versions set stone. However, common development environment important establish working across multiple companies multiple developers. currently recommend developers work latest R version latest available packages. However, deviate time developers come go admiral. actually see positive, .e. deviations developers, introduces bit random stress testing code base. GitHub allows us Actions/Workflows test admiral several versions R well several versions dependent R packages needed admiral. Currently test admiral two latest R Versions closest snapshots packages R versions. can view workflow others admiralci GitHub Repository.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"common-r-cmd-check-issues","dir":"Articles","previous_headings":"","what":"Common R CMD Check Issues","title":"R CMD Issues","text":"R CMD check command line tool checks R packages standard set criteria. pull request pass check must issue notes, warnings errors. list common issues resolve .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"check-fails-only-on-one-version","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Check Fails Only on One Version","title":"R CMD Issues","text":"R CMD check workflow fails one two R versions can helpful reproduce testing environment locally. reproduce particular R version environment open admiral project corresponding R version, comment line source(\"renv/activate.R\") .Rprofile file, restart R session run following commands R console. ensure exact package versions use workflow installed hidden folder .library. way existing R packages overwritten.","code":"Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS = \"true\") if (!dir.exists(\".library\")) { dir.create(\".library\") } base_recommended_pkgs <- row.names(installed.packages(priority = \"high\")) for (pkg in base_recommended_pkgs) { path <- file.path(.Library, pkg) cmd <- sprintf(\"cp -r %s .library\", path) system(cmd) } assign(\".lib.loc\", \".library\", envir = environment(.libPaths)) r_version <- getRversion() if (grepl(\"^4.1\", r_version)) { options(repos = \"https://packagemanager.posit.co/cran/2021-05-03/\") } else if (grepl(\"^4.2\", r_version)) { options(repos = \"https://packagemanager.posit.co/cran/2022-01-03/\") } else if (grepl(\"^4.3\", r_version)) { options(repos = \"https://packagemanager.posit.co/cran/2023-04-20/\") } else { options(repos = \"https://cran.rstudio.com\") } if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_deps(dependencies = TRUE) remotes::install_github(\"pharmaverse/pharmaversesdtm\", ref = \"devel\") remotes::install_github(\"pharmaverse/admiraldev\", ref = \"devel\") rcmdcheck::rcmdcheck()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"package-dependencies","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Package Dependencies","title":"R CMD Issues","text":"Add pkg Imports Suggests field DESCRIPTION file. general, dependencies listed Imports field. However, package used inside vignettes unit tests listed Suggests admiral functions work without “soft” dependencies installed.","code":"> checking package dependencies ... ERROR Namespace dependency not required: ‘pkg’"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"global-variables","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Global Variables","title":"R CMD Issues","text":"Add some_var list “global” variables R/globals.R.","code":"❯ checking R code for possible problems ... NOTE function_xyz: no visible binding for global variable ‘some_var’"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"undocumented-function-parameter","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Undocumented Function Parameter","title":"R CMD Issues","text":"Add @param some_param section header function_xyz() run devtools::document() afterwards.","code":"❯ checking Rd \\usage sections ... WARNING Undocumented arguments in documentation object 'function_xyz' ‘some_param’"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"outdated-documentation","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Outdated Documentation","title":"R CMD Issues","text":"name parameter changed function code yet header. Change @param old_param_name @param new_param_name run devtools::document(). reading recommend R-pkg manual r-cmd chapter","code":"❯ checking for code/documentation mismatches ... WARNING Codoc mismatches from documentation object 'function_xyz': ... Argument names in code not in docs: new_param_name Argument names in docs not in code: old_param_name Mismatches in argument names: Position: 6 Code: new_param_name Docs: old_param_name"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Release Strategy","text":"article explains package releases admiral across package extensions. includes details around planned/scheduled releases, well hotfixes.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"release-schedule","dir":"Articles","previous_headings":"","what":"Release Schedule","title":"Release Strategy","text":"release schedule maintained homepage.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"planning-releases","dir":"Articles","previous_headings":"","what":"Planning Releases","title":"Release Strategy","text":"past, whenever started looking towards future release, create new release issue label GitHub form release Q4-2022 prioritize issues. However, backlog minimal every issue considered Priority Issue. issue Priority, sent back Discussion Tab formed Priority issue. share advance users high level summary expected package updates via community meetings, especially anticipated breaking changes.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"package-release-process","dir":"Articles","previous_headings":"","what":"Package Release Process","title":"Release Strategy","text":"following important steps planned release hot fix release described. Depending package may helpful use usethis::use_release_issue() package-specific release_bullets() function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"planned-release","dir":"Articles","previous_headings":"Package Release Process","what":"Planned Release","title":"Release Strategy","text":"package release done following steps: Create release version: Create new feature branch main. Call usethis::use_version() update Versions: field DESCRIPTION file update NEWS.md (replace “(development version)” version released) Create PR main merge . title PR must contain “[skip vbump]”. Otherwise, vbump workflow sets version development version CRAN reject submission. Bundle main (devtools::build(manual = TRUE)) send CRAN. See chapter R Packages details. CRAN asks modifications, repeat steps 1-2 necessary. package accepted available CRAN, use release button GitHub “release” package onto GitHub, select main branch target, use tag form vX.Y.Z, e.g., v1.1.2 (see past admiral releases reference Releasing Github section details). releases onto Github archives version code within main branch, attaches News/Changelog file, bundles code tar.gz file makes validation report via GitHub action validation insightsengineering/validatoR. also builds website released version stores new vx.y.z folder gh-pages branch. Merge main patch prepared case needed hotfix. Create next development version: Create new feature branch main. Call usethis::use_dev_version() update NEWS.md (adds new section # admiral (development version)) update version DESCRIPTION file development version. Create PR main merge .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"hot-fix-release","dir":"Articles","previous_headings":"Package Release Process","what":"Hot Fix Release","title":"Release Strategy","text":"Rarely, may need release hot fix immediately address bug. majority cases, -cycle release can made directly main branch, bug fixes new features released earlier planned, thus avoiding patch branch release. hot fix release done following steps: Identify bugs need fixed hot fix release label “hotfix” label. Branches addressing bugs Pull Requests merged single patch branch main branch, patch branch created recent release package. , run following git commands: git checkout -b patch vX.Y.Z git push -u origin patch need use development versions. .e., first pull request set version DESCRIPTION version released corresponding heading added NEWS.md. naming branch follow naming conventions guide. PRs hot fix merged (patch), bundle patch (devtools::build(manual = TRUE)) send CRAN. See chapter R Packages details. CRAN asks modifications, repeat steps 1-4 necessary. package accepted available CRAN, , use release button GitHub “release” package onto GitHub, select patch branch target, use tag form vX.Y.Z, e.g., v1.1.2 (see past admiral releases reference Releasing Github section details). releases onto Github archives version code within patch branch, attaches News/Changelog file, bundles code tar.gz file makes validation report via GitHub action validation insightsengineering/validatoR. also builds website released version stores new vx.y.z folder gh-pages branch. hot fixes merged main branch additional Pull Request. Merging PR update version DESCRIPTION file development version. Create next development version: Create new feature branch main. Update NEWS.md (add new section # admiral (development version)) Create PR main merge .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"releasing-to-github","dir":"Articles","previous_headings":"","what":"Releasing to Github","title":"Release Strategy","text":"Releases section main repo, select Draft New Release. Proceed creating appropriate release tag header, denoted vX.X.X admiral X.X.X respectively, release: Copy contents NEWS.md section release, paste release notes section: upload box says, “Attach binaries dropping selecting ” upload appropriate admiral_X.X.X.tar.gz file available download CRAN website. Click Publish Release ’re done! NB: Occasionally, might need delete tag something done error. Deleting tag can done GitHub must done terminal. However, easy!! Just use: git push --delete origin tagname","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"release-tracking","dir":"Articles","previous_headings":"","what":"Release Tracking","title":"Release Strategy","text":"new package release submitted CRAN awaiting go-live, can track status searching within dashboard.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"communications","dir":"Articles","previous_headings":"","what":"Communications","title":"Release Strategy","text":"release, raise awareness via Slack channel LinkedIn.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"unit-tests-become-a-safety-net-for-developers","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Unit Tests Become a Safety Net for Developers","title":"Unit Test Guidance","text":"comprehensive suite unit tests can act safety net developers. frequently running tests, can assure recent modifications code haven’t broken anything. words, unit tests help prevent regressions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"unit-tests-can-contribute-to-higher-code-quality","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Unit Tests Can Contribute to Higher Code Quality","title":"Unit Test Guidance","text":"Since unit tests act safety net, developers become confident changing code. can refactor code without fear breaking things, driving general quality code base .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"unit-tests-can-contribute-to-better-application-architecture","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Unit Tests Can Contribute to Better Application Architecture","title":"Unit Test Guidance","text":"can add unit tests easily code base, ’s usually good sign regarding quality app’s architecture. , drive write testable code can incentive better architecture.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"detects-code-smells-in-your-codebase","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Detects Code Smells in your Codebase","title":"Unit Test Guidance","text":"ease adding unit tests code base good sign, opposite also true. hard time creating unit tests given piece code might sign code smells code—e.g. functions complex.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-fast","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Tests Should Be Fast","title":"Unit Test Guidance","text":"’re slow, developers won’t run often . defeats whole purpose suite unit tests first place, boost developers’ confidence make changes code. tests can’t work safety net ’re run often.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-simple","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Tests Should Be Simple","title":"Unit Test Guidance","text":"several techniques can apply high degree confidence correctness tests. One keep tests low cyclomatic complexity. Cyclomatic complexity code metric indicates number possible execution paths given method can follow. piece code lower complexity easier understand maintain, means developers less likely introduce bugs working . can measure cyclomatic complexity tests (using, instance, linter tool) best keep low.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"test-shouldnt-duplicate-implementation-logic","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Test Shouldn’t Duplicate Implementation Logic","title":"Unit Test Guidance","text":"person wrote test implementation, ’s possible made errors places. Since tests mirror implementation, might still pass, implementation wrong, tests might fool thinking otherwise. Resist urge make tests fancy, keep simple, testing suite better .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-readable","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Tests Should Be Readable","title":"Unit Test Guidance","text":"best practice overlaps little bit one keeping tests simple. tests hard read, developers likely misunderstand introduce bugs. Test cases used form documentation, obviously need readable.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"running-unit-tests-part-of-the-build-process","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Running Unit Tests Part of the Build Process","title":"Unit Test Guidance","text":"Automate whole process running unit tests taking action fail. build process execute unit tests mark build broken tests fail.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"plan-your-unit-tests","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Plan your Unit Tests","title":"Unit Test Guidance","text":"Start considering derivation rule testing possible arguments/flexibilities function code. plan scenarios test. can either involve generating different input test cases feeding different calls function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"test-coverage","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Test coverage","title":"Unit Test Guidance","text":"Unit tests cover functionality function. another function g() called within function f(), unit tests f() test functionality g(). tested unit tests g(), .e. unit tests added lowest level.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-robust-to-cover-realistic-data-scenarios","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Tests Should be Robust to Cover Realistic Data Scenarios","title":"Unit Test Guidance","text":"generating input test cases, can helpful consider regular cases (expected common data scenarios), boundary cases (data points close equal), special cases (uncommon valid data scenarios, e.g. missing special characters). Although never cover every single eventuality possible input data (reliability testing method ever gives 100% certainty), need give confidence code robust enough work across data scenarios.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"testing-should-cover-possible-arguments","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Testing Should Cover Possible Arguments","title":"Unit Test Guidance","text":"different calls function, consider user might apply function test variety possible calls, whilst still remembering tips tests fast simple. needed cases complexity level flexibility function justifies , e.g. see test script: https://github.com/pharmaverse/admiral/blob/main/tests/testthat/test-derive_var_extreme_flag.R.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"exported-functions","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Exported Functions","title":"Unit Test Guidance","text":"Don’t forget add unit test exported function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"snapshot-testing","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Snapshot Testing","title":"Unit Test Guidance","text":"Standard unit tests always convenient record expected behavior code. challenges include: Output large, making painful define reference output, bloating size test file making hard navigate. Text output includes many characters like quotes newlines require special handling string. Binary formats like plots images, difficult describe code: .e. plot looks right, error message useful human, print method uses color effectively. situations, testthat provides alternative mechanism: snapshot tests. Snapshot tests record results separate human readable file records results, including output, messages, warnings, errors. Review {testthat} snapshot vignette details.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"set-up-the-test-script","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Set up the Test Script","title":"Unit Test Guidance","text":"Within tests/testthat folder project, add script naming convention test-.R., unit test script can created console also, follows: testing framework used testthat following format : example, testing function called my_new_func contained script all_funcs.R console use: Open newly created file test-all_funcs.R use following format: Note: comparing datasets admiral use function expect_dfs_equal(). input expected output unit tests must follow following rules: Input output simple possible. Values hard-coded whenever possible. values need derived, unit tested functions can used. contrast Programming Strategy documentation function examples, test files include library(pkg_name) calls. dataset needs created testing purposes, done using function tribble() tibble package following command dplyr::tribble(). Furthermore, functions need called, also done using pkg_name::fun()notation. Make sure align columns well. ensures quick code readability. Ensure give meaningful explanation test testthat call, compiled package validation report. name function test ID included title also help traceability. comments ending ---- create entries TOC RStudio.","code":"usethis::use_test(\"\") ## Test 1: ---- test_that(\" Test 1: \", { input <- dplyr::tribble( ~inputvar1, ~inputvar2, ... ... ) expected_output <- mutate(input, outputvar = c()) expect_dfs_equal((input), expected_output) }) usethis::use_test(\"all_funcs\") # my_new_func ---- ## Test 1: ---- test_that(\"my_new_func Test 1: \", { input <- dplyr::tribble( ~inputvar1, ~inputvar2, ... ... ) expected_output <- mutate(input, outputvar = c()) expect_dfs_equal((input), expected_output) })"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"addin-pharmaverse4devsformat_test_that_file","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Addin pharmaverse4devs::format_test_that_file()","title":"Unit Test Guidance","text":"ease burden developers writing adding tests developed Addin formatting test_that test files according admiral programming standards. Addin add update comments well number re-numbers tests. access Addin, sure install {pharmaverse4devs} Github. install latest development version package directly GitHub use following code: use Addin button select “Format test_that test file” seen image. sure test-file open selected calling Addin. Addin perform following: Updates adds number tests comments test_that() call Updates comments based description provided test_that() call Updates function name test_that() call. function name extracted last # ---- comment test_that() call. test file tests one function, comments added first test function. test files tests single function , comments can omitted. case addin determines function name file name stripping “test-” prefix “.R” suffix. writing new unit tests, just provide description test_that() call necessary function name # ---- comment: Call addin get: tested unit test program, can run unit tests console, follows. running just tests current file call","code":"if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_github(\"pharmaverse/pharmaverse4devs\") # derive_vars_merged ---- test_that( \"works if it merges all variables\", { actual <- derive_vars_merged(advs, dataset_add = adsl, by_vars = exprs(STUDYID, USUBJID) ) # convert_dtm_to_dtc ---- test_that(\"works if dtm is in correct format\", { expect_equal( convert_dtm_to_dtc(as.POSIXct(\"2022-04-05 15:34:07 UTC\")), \"2022-04-05T15:34:07\" ) }) test_that(\"Error is thrown if dtm is not in correct format\", { expect_error( convert_dtm_to_dtc(\"2022-04-05T15:26:14\"), \"lubridate::is.instant(dtm) is not TRUE\", fixed = TRUE ) }) # derive_vars_merged ---- ## Test 1: derive_vars_merged ---- test_that( \"derive_vars_merged Test 1: it merges all variables\", { actual <- derive_vars_merged(advs, dataset_add = adsl, by_vars = exprs(STUDYID, USUBJID) ) # convert_dtm_to_dtc ---- ## Test 2: works if dtm is in correct format ---- test_that(\"convert_dtm_to_dtc Test 2: works if dtm is in correct format\", { expect_equal( convert_dtm_to_dtc(as.POSIXct(\"2022-04-05 15:34:07 UTC\")), \"2022-04-05T15:34:07\" ) }) ## Test 3: Error is thrown if dtm is not in correct format ---- test_that(\"convert_dtm_to_dtc Test 3: Error is thrown if dtm is not in correct format\", { expect_error( convert_dtm_to_dtc(\"2022-04-05T15:26:14\"), \"lubridate::is.instant(dtm) is not TRUE\", fixed = TRUE ) }) devtools::test() devtools::test_file()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"automation-of-unit-tests","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Automation of Unit Tests","title":"Unit Test Guidance","text":"user actions pull request {admiral} GitHub repo, unit tests automatically run pull request denied unit tests fail.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Writing Vignettes","text":"guidance ensures consistency across vignettes admiral package terms content, structure code execution. general rule, vignette workflow defined r-pkgs.org followed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"metadata","dir":"Articles","previous_headings":"","what":"Metadata","title":"Writing Vignettes","text":"vignette admiral start following metadata. vignette meaningful.","code":"--- title: \"\" output: rmarkdown::html_vignette: vignette: > %\\VignetteIndexEntry{} %\\VignetteEngine{knitr::rmarkdown} ---"},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"default-options","dir":"Articles","previous_headings":"Markdown","what":"Default Options","title":"Writing Vignettes","text":"chunks used within vignette, following options set metadata ensure chunks rendered consistently across vignettes.","code":"```{r setup, include=FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = \"#>\" ) ```"},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"table-of-contents","dir":"Articles","previous_headings":"Markdown > Format Sections","what":"Table of Contents","title":"Writing Vignettes","text":"Headings must title case start Heading 1: first section gives brief introduction vignette. last sub-section introduction describe packages required run admiral functions. admiral package described first. warning=FALSE message=FALSE options prevent usual messages: Attaching package: ‘xxxx’following objects masked ‘package:yyyyy’ fun1, fun2","code":"# Heading 1 This is the description of my first section. ## Heading 1.1 This is the description of my first sub-section within my first section. ## Heading 1.2 This is the description of my second sub-section within my first section. # Introduction This is the introduction of my vignette. ## Required Packages ```{r, warning=FALSE, message=FALSE} library(admiral) # ```"},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"general-conventions","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"General Conventions","title":"Writing Vignettes","text":"new vignette must added _pkgdown.yml file relevant section. variable name, dataset name, function, argument name must quoted backticks: e.g. Functions must also end (). Variables datasets name expected uppercase. codes must described, executed output result displayed code executed. Use: output created must clearly show function derived. least show variables/records used input function derived variables/records. dataset must displayed, formatted using dataset_vignette() function displayed consistently across vignettes.E.g. Description execution code used derive variable/record Output dataset formatted using dataset_vignette()… Note: call get formatted dataset : Displaying many big datasets vignette, may require long time load page may cause messages browser page responsive. case number displayed observations restricted either restricting source datasets beginning vignette call dataset_vignette() calls affected.","code":"The `date` parameter of the `derive_my_var()` function expects a date variable, e.g., `ADT`. ```{r} # ``` vs1 <- vs %>% derive_vars_dt( new_vars_prefix = \"A\", dtc = VSDTC, date_imputation = \"first\" ) ``` r dataset_vignette( vs1, display_vars = exprs(USUBJID, VSTESTCD, VISIT, VSDTC, ADT), filter = VSTESTCD == \"WEIGHT\" ) ```"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"using-footnotes","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Using Footnotes","title":"Writing Vignettes","text":"Footnotes can useful add context without adding clutter primary subject matter vignette written. use footnotes, add caret identifier inside brackets e.g. ([^1]). identifiers can numbers words, can’t contain spaces tabs. following markdown text render follows: example 1","code":"Here is an example [^1] [^1]: Cool note about the example."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"conventions-for-adam-workflow","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Conventions for ADaM Workflow","title":"Writing Vignettes","text":"vignettes describing ADaM workflow, second section summarize programming workflow. first sub-section within workflow always describe data read demonstrate use admiral functions, sub-section within programming workflow tagged (e.g. [Step1] (#step)), user can go relevant section programming workflow (addition Table contents). Don’t use tag number use meaningful name (e.g. use (#link1), use (#this_action)) last section link template script. ADSL variables ADSL variables required derivation merged SDTM dataset first derivation. ADSL variables added -variables derivations add observations. ensures ADSL variables populated new observations. adsl_vars variable created beginning script added by_vars parameter derivations add observations. ADSL variables final dataset required derivation merged dataset last derivation.","code":"# Programming Workflow * [Read in Data](#readdata) * [Derive/Impute End and Start Analysis Date/time and Relative Day](#datetime) * ... * [Assign `ASEQ`](#aseq) ## Read in Data {#readdata} ## Derive/Impute End and Start Analysis Date/time and Relative Day {#datetime} ## ... ## Assign `ASEQ` {#aseq} # Another Section # Example Script ADaM | Sample Code ---- | -------------- ADxx | [ad_adxx.R](https://github.com/pharmaverse/admiral/blob/main/inst/templates/ad_adxx.R){target=\"_blank\"}"},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ben Straub. Author, maintainer. Stefan Bundfuss. Author. Jeffrey Dickinson. Author. Ross Farrugia. Author. Fanny Gautier. Author. Edoardo Mancini. Author. Sadchla Mascary. Author. Gordon Miller. Author. Daniel Sjoberg. Author. Stefan Thoma. Author. Kangjie Zhang. Author. Zelos Zhu. Author. F. Hoffmann-La Roche AG. Copyright holder, funder. GlaxoSmithKline LLC. Copyright holder, funder.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Straub B, Bundfuss S, Dickinson J, Farrugia R, Gautier F, Mancini E, Mascary S, Miller G, Sjoberg D, Thoma S, Zhang K, Zhu Z (2025). admiraldev: Utility Functions Development Tools Admiral Package Family. R package version 1.1.0.9008, https://github.com/pharmaverse/admiraldev/, https://pharmaverse.github.io/admiraldev/.","code":"@Manual{, title = {admiraldev: Utility Functions and Development Tools for the Admiral Package Family}, author = {Ben Straub and Stefan Bundfuss and Jeffrey Dickinson and Ross Farrugia and Fanny Gautier and Edoardo Mancini and Sadchla Mascary and Gordon Miller and Daniel Sjoberg and Stefan Thoma and Kangjie Zhang and Zelos Zhu}, year = {2025}, note = {R package version 1.1.0.9008, https://github.com/pharmaverse/admiraldev/}, url = {https://pharmaverse.github.io/admiraldev/}, }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"admiraldev-","dir":"","previous_headings":"","what":"Utility Functions and Development Tools for the Admiral Package Family","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Utility Functions Development Tools Admiral Package Family","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"purpose","dir":"","previous_headings":"","what":"Purpose","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Functions, tools documentation developing core admiral extension package functions. functions admiraldev around testing inputs going functions. also additional quality life functions/Addins assist developers admiral admiral extension packages, functions help rendering documentation, Developer Guides developing function using GitHub, GitHub Actions. NOTE: package intended standalone use rather central dependency admiral extension packages","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"package available CRAN can installed running install.packages(\"admiraldev\"). install latest development version package directly GitHub use following code:","code":"if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_github(\"pharmaverse/admiraldev\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"release-schedule","dir":"","previous_headings":"","what":"Release Schedule","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"admiraldev released CRAN time official release admiral. can find release schedule admiral packages .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Along authors contributors, thanks following people work package: Ania Golab, Samia Kabi, Pooja Kumari, Syed Mubasheer, Thomas Neitmann Ondrej Slama.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"Add suffix variables list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"add_suffix_to_vars(order, vars, suffix)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"order List expressions Permitted Values: list variables desc() function calls created exprs(), e.g., exprs(ADT, desc(AVAL)) vars Variables change Permitted Values: list variables created exprs() suffix Suffix Permitted Values: character scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"list expression element suffix (suffix) added every symbol specified vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) add_suffix_to_vars(exprs(ADT, desc(AVAL), AVALC), vars = exprs(AVAL), suffix = \".join\") #> [[1]] #> ADT #> #> [[2]] #> desc(AVAL.join) #> #> [[3]] #> AVALC #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":null,"dir":"Reference","previous_headings":"","what":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Utility functions check data, variables conditions functions used 'admiral' 'admiral' extension packages. Additional utility helper functions assist developers maintaining documentation, testing general upkeep 'admiral' 'admiral' extension packages.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Maintainer: Ben Straub ben.x.straub@gsk.com Authors: Stefan Bundfuss (ORCID) Jeffrey Dickinson Ross Farrugia Fanny Gautier Edoardo Mancini (ORCID) Sadchla Mascary Gordon Miller Daniel Sjoberg (ORCID) Stefan Thoma (ORCID) Kangjie Zhang Zelos Zhu contributors: F. Hoffmann-La Roche AG [copyright holder, funder] GlaxoSmithKline LLC [copyright holder, funder]","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract Argument Name from an Expression — arg_name","title":"Extract Argument Name from an Expression — arg_name","text":"Extract Argument Name Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract Argument Name from an Expression — arg_name","text":"","code":"arg_name(expr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract Argument Name from an Expression — arg_name","text":"expr expression created inside function using substitute()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract Argument Name from an Expression — arg_name","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Atomic Vector? — assert_atomic_vector","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"Checks argument atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"assert_atomic_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_atomic_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"function throws error arg atomic vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"example_fun <- function(x) { assert_atomic_vector(x) } example_fun(1:10) try(example_fun(list(1, 2))) #> Error in example_fun(list(1, 2)) : #> Argument `x` must be an atomic vector, but is a list."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Scalar (String)? — assert_character_scalar","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"Checks argument character scalar (optionally) whether matches one provided values.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"assert_character_scalar( arg, values = NULL, case_sensitive = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"arg function argument checked values character vector valid values arg. Values converted lower case vector case_sensitive = FALSE used. case_sensitive argument handled case-sensitive? set FALSE, argument converted lower case checking permitted values returning argument. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"function throws error arg character vector arg character vector length > 1 value one values specified. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"example_fun <- function(msg_type) { assert_character_scalar(msg_type, values = c(\"warning\", \"error\")) } example_fun(\"warning\") try(example_fun(\"message\")) #> Error in example_fun(\"message\") : #> Argument `msg_type` must be equal to one of \"warning\" or \"error\". try(example_fun(TRUE)) #> Error in example_fun(TRUE) : #> Argument `msg_type` must be a scalar of class , but is #> `TRUE`. # handling arguments case-insensitive example_fun2 <- function(msg_type) { msg_type <- assert_character_scalar( msg_type, values = c(\"warning\", \"error\"), case_sensitive = FALSE ) if (msg_type == \"warning\") { print(\"A warning was requested.\") } } example_fun2(\"Warning\") #> [1] \"A warning was requested.\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Vector? — assert_character_vector","title":"Is an Argument a Character Vector? — assert_character_vector","text":"Checks argument character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"assert_character_vector( arg, values = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Vector? — assert_character_vector","text":"arg function argument checked values character vector valid values arg named set TRUE, error issued elements vector named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Vector? — assert_character_vector","text":"function throws error arg character vector element included list valid values. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"example_fun <- function(chr) { assert_character_vector(chr) } example_fun(letters) try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `chr` must be , but is an integer vector. example_fun2 <- function(chr) { assert_character_vector(chr, named = TRUE) } try(example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\"))) #> Error in example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\")) : #> All elements of `chr` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Data Frame? — assert_data_frame","title":"Is an Argument a Data Frame? — assert_data_frame","text":"Checks argument data frame (optionally) whether contains set required variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"assert_data_frame( arg, required_vars = NULL, check_is_grouped = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_data_frame\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Data Frame? — assert_data_frame","text":"arg function argument checked required_vars list variables created using exprs() check_is_grouped Throw error dataset grouped? Defaults TRUE. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Data Frame? — assert_data_frame","text":"function throws error arg data frame arg data frame misses variable specified required_vars. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"library(dplyr) library(rlang) dm <- tribble( ~STUDYID, ~USUBJID, \"XYZ\", \"1\", \"XYZ\", \"2\" ) example_fun <- function(dataset) { assert_data_frame(dataset, required_vars = exprs(STUDYID, USUBJID)) } example_fun(dm) try(example_fun(select(dm, -STUDYID))) #> Error in example_fun(select(dm, -STUDYID)) : #> Required variable `STUDYID` is missing in `dataset` try(example_fun(\"Not a dataset\")) #> Error in example_fun(\"Not a dataset\") : #> Argument `dataset` must be class , but is a string. try(example_fun(group_by(dm, USUBJID))) #> Error in example_fun(group_by(dm, USUBJID)) : #> Argument `dataset` must not be a grouped dataset, please `ungroup()` it."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"Checks variable dataset date datetime variable","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"assert_date_var( dataset, var, dataset_name = rlang::caller_arg(dataset), var_name = rlang::caller_arg(var), message = NULL, class = \"assert_date_var\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"dataset dataset variable expected var variable check dataset_name name dataset. argument specified, specified name displayed error message. var_name name variable. argument specified, specified name displayed error message. message (string) string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"var_name\" \"dataset_name\", can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"function throws error var date datetime variable dataset returns input invisibly otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"library(lubridate) #> #> Attaching package: ‘lubridate’ #> The following objects are masked from ‘package:base’: #> #> date, intersect, setdiff, union library(dplyr) library(rlang) example_fun <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var(dataset = dataset, var = !!var) } my_data <- tribble( ~USUBJID, ~ADT, \"1\", ymd(\"2020-12-06\"), \"2\", ymd(\"\") ) example_fun( dataset = my_data, var = ADT ) try(example_fun( dataset = my_data, var = USUBJID )) #> Error in example_fun(dataset = my_data, var = USUBJID) : #> Column \"USUBJID\" in dataset `dataset` must be a date or datetime, but is #> a character vector. example_fun2 <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var( dataset = dataset, var = !!var, dataset_name = \"your_data\", var_name = \"your_var\" ) } try(example_fun2( dataset = my_data, var = USUBJID )) #> Error in example_fun2(dataset = my_data, var = USUBJID) : #> Column \"your_var\" in dataset `your_data` must be a date or datetime, but #> is a character vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object a date or datetime vector? — assert_date_vector","title":"Is an object a date or datetime vector? — assert_date_vector","text":"Check object/vector date datetime variable without needing dataset input","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"assert_date_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_date_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object a date or datetime vector? — assert_date_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL function assert_date_vector exits early throw error. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an object a date or datetime vector? — assert_date_vector","text":"function returns error arg missing, date datetime variable otherwise returns invisible output.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"example_fun <- function(arg) { assert_date_vector(arg) } example_fun( as.Date(\"2022-01-30\", tz = \"UTC\") ) try(example_fun(\"1993-07-14\")) #> Error in example_fun(\"1993-07-14\") : #> Argument `arg` must be a date or datetime, but is a string."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is an Expression — assert_expr","title":"Assert Argument is an Expression — assert_expr","text":"Assert Argument Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is an Expression — assert_expr","text":"","code":"assert_expr( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_expr\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is an Expression — assert_expr","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is an Expression — assert_expr","text":"function throws error arg expression, .e. either symbol call, returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Expressions? — assert_expr_list","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"Checks argument list expressions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"assert_expr_list( arg, required_elements = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_expr_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"arg function argument checked required_elements character vector names must present arg named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"function throws error arg list expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"library(rlang) example_fun <- function(vars) { assert_expr_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\")))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\"))) : #> All elements of `vars` must be an expression. #> ℹ `vars[[3]]` = `list(\"a\")` is of type , and `vars[[4]]` = `list(\"a\")` is #> of type "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Filter Condition? — assert_filter_cond","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Argument Filter Condition?","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"assert_filter_cond( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_filter_cond\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"arg Quosure - filtering condition. optional Logical - argument optional? Defaults FALSE. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Performs necessary checks returns arg pass. Otherwise throws informative error.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Check arg suitable filtering condition used functions like subset dplyr::filter.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~STUDYID, ~USUBJID, ~AGE, \"DM\", \"STUDY X\", \"01-701-1015\", 64, \"DM\", \"STUDY X\", \"01-701-1016\", 65, ) # typical usage in a function as an argument check example_fun <- function(dat, x) { x <- assert_filter_cond(enexpr(x), arg_name = \"x\") filter(dat, !!x) } example_fun(dm, AGE == 64) #> # A tibble: 1 × 4 #> DOMAIN STUDYID USUBJID AGE #> #> 1 DM STUDY X 01-701-1015 64 try(assert_filter_cond(mtcars)) #> Error in eval(expr, envir) : #> Argument `mtcars` must be a filter condition, but is a data frame"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Is Argument a Function? — assert_function","title":"Is Argument a Function? — assert_function","text":"Checks argument function expected arguments provided function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is Argument a Function? — assert_function","text":"","code":"assert_function( arg, params = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_function\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is Argument a Function? — assert_function","text":"arg function function checked params character vector character vector expected argument names aforementioned function arg. ellipsis, ..., included function formals function arg, argument, params ignored, accepting values character vector. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is Argument a Function? — assert_function","text":"function throws error argument function function provide arguments specified params argument (assuming ellipsis function formals)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is Argument a Function? — assert_function","text":"","code":"example_fun <- function(fun) { assert_function(fun, params = c(\"x\")) } example_fun(mean) try(example_fun(1)) #> Error in example_fun(1) : #> Argument `fun` must be a function, but is a number. try(example_fun(sum)) #> Error in example_fun(sum) : #> \"x\" is not an argument of the function specified for `fun`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Integer Scalar? — assert_integer_scalar","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"Checks argument integer scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"assert_integer_scalar( arg, subset = \"none\", optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_integer_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"arg function argument checked subset subset integers arg part . one \"none\" (default), \"positive\", \"non-negative\" \"negative\". optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"function throws error arg integer belonging specified subset. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"example_fun <- function(num1, num2) { assert_integer_scalar(num1, subset = \"positive\") assert_integer_scalar(num2, subset = \"negative\") } example_fun(1, -9) try(example_fun(1.5, -9)) #> Error in example_fun(1.5, -9) : #> Argument `num1` must be a positive integer scalar. try(example_fun(2, 0)) #> Error in example_fun(2, 0) : #> Argument `num2` must be a negative integer scalar. try(example_fun(\"2\", 0)) #> Error in example_fun(\"2\", 0) : #> Argument `num1` must be a positive integer scalar."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"Checks elements list named lists/classes fulfill certain condition. , error issued elements list fulfilling condition listed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"assert_list_element( list, element, condition, message_text, arg_name = rlang::caller_arg(list), message = NULL, class = \"assert_list_element\", call = parent.frame(), ... )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"list list checked list named lists classes expected. element name element lists/classes character scalar expected. condition Condition fulfilled condition evaluated element list. element lists/classes can referred name, e.g., censor == 0 check censor field class. message_text Text displayed error message listing values meet condition. text describe condition fulfilled, e.g., \"Error {arg_name}: censor values must zero.\". message argument specified, text displayed message_text ignored. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages. ... Objects required evaluate condition message text condition message text contains objects apart element, passed function. See second example .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"error condition met. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"death <- list( dataset_name = \"adsl\", date = \"DTHDT\", censor = 0 ) lstalv <- list( dataset_name = \"adsl\", date = \"LSTALVDT\", censor = 1 ) events <- list(death, lstalv) try(assert_list_element( list = events, element = \"censor\", condition = censor == 0, message_text = \"For events the censor values must be zero.\" )) #> Error in eval(expr, envir) : #> For events the censor values must be zero. #> ℹ But, `events[[2]]$censor = 1` try(assert_list_element( list = events, element = \"dataset_name\", condition = dataset_name %in% c(\"adrs\", \"adae\"), valid_datasets = c(\"adrs\", \"adae\"), message_text = paste( \"The dataset name must be one of the following: {.val {valid_datasets}}\" ) )) #> Error in eval(expr, envir) : #> The dataset name must be one of the following: \"adrs\" and \"adae\" #> ℹ But, `events[[1]]$dataset_name = adsl`, and `events[[2]]$dataset_name = adsl`"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"Checks argument list objects inheriting S3 class type specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"assert_list_of( arg, cls, named = FALSE, optional = TRUE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_list_of\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"arg function argument checked cls S3 class type check named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"function throws error arg list arg list elements objects inheriting class type class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"example_fun <- function(list) { assert_list_of(list, \"data.frame\") } example_fun(list(mtcars, iris)) try(example_fun(list(letters, 1:10))) #> Error in example_fun(list(letters, 1:10)) : #> Each element of the list in argument `list` must be class/type #> . #> ℹ But, element 1 is a character vector, and element 2 is an integer vector try(example_fun(c(TRUE, FALSE))) #> Error in example_fun(c(TRUE, FALSE)) : #> Argument `list` must be class , but is a logical vector. example_fun2 <- function(list) { assert_list_of(list, \"numeric\", named = TRUE) } try(example_fun2(list(1, 2, 3, d = 4))) #> Error in example_fun2(list(1, 2, 3, d = 4)) : #> All elements of `list` argument must be named. #> ℹ The indices of the unnamed elements are 1, 2, and 3"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"Checks argument logical scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"assert_logical_scalar( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_logical_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown. Otherwise, NULL considered valid value. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"function throws error arg neither TRUE FALSE. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"example_fun <- function(flag) { assert_logical_scalar(flag) } example_fun(FALSE) try(example_fun(NA)) #> Error in example_fun(NA) : #> Argument `flag` must be either TRUE or FALSE, but is `NA`. try(example_fun(c(TRUE, FALSE, FALSE))) #> Error in example_fun(c(TRUE, FALSE, FALSE)) : #> Argument `flag` must be either TRUE or FALSE, but is a logical vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `flag` must be either TRUE or FALSE, but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is a Named List or Vector — assert_named","title":"Assert Argument is a Named List or Vector — assert_named","text":"Assert elements argument named.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"assert_named( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_named\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is a Named List or Vector — assert_named","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is a Named List or Vector — assert_named","text":"function throws error arg named list vector returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"example_fun <- function(varval_list) { assert_named(varval_list) } example_fun(list(var1 = 1, var2 = \"x\")) try(example_fun(list(1, \"x\"))) #> Error in example_fun(list(1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 1 and 2 try(example_fun(list(var = 1, \"x\"))) #> Error in example_fun(list(var = 1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Numeric Vector? — assert_numeric_vector","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"Checks argument numeric vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"assert_numeric_vector( arg, length = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_numeric_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"arg function argument checked length Expected length argument specified set NULL, length accepted. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"function throws error arg numeric vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"example_fun <- function(num) { assert_numeric_vector(num) } example_fun(1:10) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `num` must be a numeric vector, but it is a character vector. example_fun <- function(num) { assert_numeric_vector(num, length = 2) } try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `num` must be a vector of length 2, but has length 10."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":null,"dir":"Reference","previous_headings":"","what":"Is There a One to One Mapping between Variables? — assert_one_to_one","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"Checks one one mapping two lists variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"assert_one_to_one( dataset, vars1, vars2, dataset_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_one_to_one\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"dataset Dataset checked variables specified vars1 vars2 expected. vars1 First list variables vars2 Second list variables dataset_name string indicating label/symbol object checked. Default rlang::caller_arg(dataset). message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"dataset_name\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"error condition meet. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"library(dplyr) library(rlang) df <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 1L ) assert_one_to_one(df, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) df_many <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 3L ) try( assert_one_to_one(df_many, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) ) #> Error in eval(expr, envir) : #> For some values of \"SPECIES\" there is more than one value of \"SPECIESN\" #> ℹ Call `admiral::get_one_to_many_dataset()` to get all one-to-many values. try( assert_one_to_one(df_many, vars1 = exprs(SPECIESN), vars2 = exprs(SPECIES)) ) #> Error in eval(expr, envir) : #> There is more than one value of \"SPECIESN\" for some values of \"SPECIES\" #> ℹ Call `admiral::get_many_to_one_dataset()` to get all many-to-one values."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"Checks parameter (PARAMCD) exist dataset.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"assert_param_does_not_exist( dataset, param, arg_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_param_does_not_exist\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"dataset data.frame param Parameter code check arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"function throws error parameter exists input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_param_does_not_exist(advs, param = \"HR\") try(assert_param_does_not_exist(advs, param = \"WEIGHT\")) #> Error in eval(expr, envir) : #> The parameter code \"WEIGHT\" already exists in dataset `advs`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"Checks argument object inheriting S3 class specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"assert_s3_class( arg, cls, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_s3_class\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"arg function argument checked cls S3 class check optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"function throws error arg object inherit class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"example_fun <- function(obj) { assert_s3_class(obj, \"factor\") } example_fun(as.factor(letters)) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `obj` must be class , but is a character vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `obj` must be class , but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Are All Argument of the Same Type? — assert_same_type","title":"Are All Argument of the Same Type? — assert_same_type","text":"Checks arguments type.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"assert_same_type( ..., .message = c(\"Arguments {.arg {arg_names}} must be the same type.\", i = paste(\"Argument types are\", paste0(\"{.arg \", arg_names, \"} {.cls \", types, \"}\", collapse = \", \"))), .class = \"assert_same_type\", .call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Are All Argument of the Same Type? — assert_same_type","text":"... Arguments checked .message character vector passed cli_abort(message) assertion fails. .class character vector passed cli_abort(class) assertion fails. .call environment passed cli_abort(call) assertion fails.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Are All Argument of the Same Type? — assert_same_type","text":"function throws error arguments type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"example_fun <- function(true_value, false_value, missing_value) { assert_same_type(true_value, false_value, missing_value) } example_fun( true_value = \"Y\", false_value = \"N\", missing_value = NA_character_ ) try(example_fun( true_value = 1, false_value = 0, missing_value = \"missing\" )) #> Error in example_fun(true_value = 1, false_value = 0, missing_value = \"missing\") : #> Arguments `true_value`, `false_value`, and `missing_value` must be the #> same type. #> ℹ Argument types are `true_value` , `false_value` , #> `missing_value` "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Symbol? — assert_symbol","title":"Is an Argument a Symbol? — assert_symbol","text":"Checks argument symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"assert_symbol( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_symbol\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Symbol? — assert_symbol","text":"arg function argument checked. Must symbol. See examples. optional checked argument optional? set FALSE arg NULL error thrown. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Symbol? — assert_symbol","text":"function throws error arg symbol returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~USUBJID, \"DM\", \"01-701-1015\", \"DM\", \"01-701-1016\", ) example_fun <- function(dat, var) { var <- assert_symbol(enexpr(var)) select(dat, !!var) } example_fun(dm, USUBJID) #> # A tibble: 2 × 1 #> USUBJID #> #> 1 01-701-1015 #> 2 01-701-1016 try(example_fun(dm)) #> Error in example_fun(dm) : #> Argument `var` must be a , but is missing. try(example_fun(dm, \"USUBJID\")) #> Error in example_fun(dm, \"USUBJID\") : #> Argument `var` must be a , but is a string. try(example_fun(dm, toupper(PARAMCD))) #> Error in example_fun(dm, toupper(PARAMCD)) : #> Argument `var` must be a , but is a call."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"Checks parameter (PARAMCD) dataset provided expected unit.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"assert_unit( dataset, param, required_unit = NULL, get_unit_expr, arg_name = rlang::caller_arg(required_unit), message = NULL, class = \"assert_unit\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"dataset Dataset checked variable PARAMCD used get_unit_expr expected. param Parameter code parameter check required_unit Expected unit(s) argument set NULL, checked whether unit unique within parameter. Permitted Values: character vector NULL get_unit_expr Expression used provide unit param arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"function throws error one non-missing unit dataset unit variable differs expected unit observation parameter input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_unit(advs, param = \"WEIGHT\", required_unit = \"kg\", get_unit_expr = VSSTRESU) try( assert_unit( advs, param = \"WEIGHT\", required_unit = c(\"g\", \"mg\"), get_unit_expr = VSSTRESU ) ) #> Error in eval(expr, envir) : #> It is expected that \"WEIGHT\" has unit of \"g\" or \"mg\". In the input #> dataset the unit is \"kg\". # Checking uniqueness of unit only advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85700, \"g\", \"WEIGHT\", 85700 ) try( assert_unit(advs, param = \"WEIGHT\", get_unit_expr = VSSTRESU) ) #> Error in eval(expr, envir) : #> Multiple units \"kg\" and \"g\" found for \"WEIGHT\". Please review and update #> the units."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Variables? — assert_vars","title":"Is an Argument a List of Variables? — assert_vars","text":"Checks argument valid list symbols (e.g., created exprs())","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"assert_vars( arg, expect_names = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_vars\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Variables? — assert_vars","text":"arg function argument checked expect_names argument set TRUE, checked variables named, e.g., exprs(APERSDT = APxxSDT, APEREDT = APxxEDT). optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Variables? — assert_vars","text":"function throws error arg list symbols (e.g., created exprs() returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(by_vars) { assert_vars(by_vars) } example_fun(exprs(USUBJID, PARAMCD)) try(example_fun(quos(USUBJID, PARAMCD))) #> Error in example_fun(quos(USUBJID, PARAMCD)) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 1 is a object, and element 2 is a object try(example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\"))) #> Error in example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\")) : #> Argument `by_vars` must be class , but is a character vector. try(example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL)))) #> Error in example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL))) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 2 is a call, and element 3 is a call example_fun_name <- function(by_vars) { assert_vars(by_vars, expect_names = TRUE) } example_fun_name(exprs(APERSDT = APxxSDT, APEREDT = APxxEDT)) try(example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT))) #> Error in example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT)) : #> All elements of `by_vars` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Variable-Value List? — assert_varval_list","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"Checks argument list expressions expressions variable-value pairs. value can symbol, string, numeric, expression, NA.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"assert_varval_list( arg, required_elements = NULL, accept_expr = TRUE, accept_var = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_varval_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"arg function argument checked required_elements character vector names must present arg accept_expr expressions right hand side accepted? accept_var unnamed variable names (e.g. exprs(USUBJID)) right hand side accepted? optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"function throws error arg list variable-value expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(vars) { assert_varval_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ)) : #> Argument `vars` must be a named list of expressions where each element #> is a symbol, character scalar, numeric scalar, an expression, or NA, but is a #> list. #> ℹ To create a list of expressions use `exprs()`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Backquotes — backquote","title":"Wrap a String in Backquotes — backquote","text":"Wrap String Backquotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Backquotes — backquote","text":"","code":"backquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Backquotes — backquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Backquotes — backquote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"check argument contains valid variable(s) created exprs() Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"","code":"contains_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"arg function argument checked","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"TRUE variables valid variable","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"Helper Function Convert Date (Date-time) Objects Characters dtc Format (-DTC type variable)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"","code":"convert_dtm_to_dtc(dtm)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"dtm date date-time","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":null,"dir":"Reference","previous_headings":"","what":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"Output dataset vignette pre-specified admiral format.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"","code":"dataset_vignette(dataset, display_vars = NULL, filter = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"dataset Dataset output vignette display_vars Variables selected demonstrate outcome derivation Permitted Values: list variables Default NULL display_vars NULL, selected variables visible vignette variables hidden. can made visible clicking theChoose columns display button. filter Filter condition specified condition applied dataset displayed. Permitted Values: condition","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"HTML table","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecation with Soft Message — deprecate_inform","title":"Deprecation with Soft Message — deprecate_inform","text":"Wrapper around lifecycle::deprecate_soft() messages users deprecated features functions instead warning.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"deprecate_inform( when, what, with = NULL, details = NULL, id = NULL, env = rlang::caller_env(), user_env = rlang::caller_env(2) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecation with Soft Message — deprecate_inform","text":"string giving version behaviour deprecated. string describing deprecated: Deprecate whole function \"foo()\". Deprecate argument \"foo(arg)\". Partially deprecate argument \"foo(arg = 'must scalar integer')\". Deprecate anything else custom message wrapping (). can optionally supply namespace: \"ns::foo()\", usually needed inferred caller environment. optional string giving recommended replacement deprecated behaviour. takes form . details cases deprecation message can automatically generated . , use details provide hand-written message. details can either single string character vector, converted bulleted list. default, info bullets used. Provide named vectors override. id id deprecation. warning issued id. Defaults generated message, give unique ID message details built programmatically depends inputs, like deprecate multiple functions warn . env, user_env Pair environments define deprecate_*() called (used determine package name) function called deprecating function called (used determine deprecate_soft() message). needed calling deprecate_*() internal helper, case forward env = caller_env() user_env = caller_env(2).","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecation with Soft Message — deprecate_inform","text":"NULL, invisibly.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"# A Phase 1 deprecated function with custom bulleted list: deprecate_inform( when = \"1.0.0\", what = \"foo()\", details = c( x = \"This message will turn into a warning with release of x.y.z\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Double Quotes — dquote","title":"Wrap a String in Double Quotes — dquote","text":"Wrap string double quotes, e.g., displaying character values messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Double Quotes — dquote","text":"","code":"dquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Double Quotes — dquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Double Quotes — dquote","text":"input NULL, text \"NULL\" returned. Otherwise, input double quotes returned.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate Multiple Elements — enumerate","title":"Enumerate Multiple Elements — enumerate","text":"Enumerate multiple elements vector list.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(x, quote_fun = backquote, conjunction = \"and\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate Multiple Elements — enumerate","text":"x vector list quote_fun Quoting function, defaults backquote. set NULL, elements quoted. conjunction Character used message, defaults \"\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate Multiple Elements — enumerate","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(c(\"one\", \"two\", \"three\")) #> Warning: `enumerate()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.val {letters[1:3]}}')` #> [1] \"`one`, `two` and `three`\" enumerate(c(1, 2, 3), quote_fun = NULL) #> [1] \"1, 2 and 3\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"Uses diffdf::diffdf() compares 2 datasets differences. function can thought R-equivalent SAS proc compare useful tool unit testing well.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"expect_dfs_equal(base, compare, keys, ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"base Input dataset compare Comparison dataset keys character vector variables define unique row base compare datasets ... Additional arguments passed onto diffdf::diffdf()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"error base compare match NULL invisibly ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"library(dplyr, warn.conflicts = FALSE) tbl1 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 19, \"F\", \"1003\", 20, \"M\", \"1004\", 18, \"F\" ) tbl2 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 18.9, \"F\", \"1003\", 20, NA ) try(expect_dfs_equal(tbl1, tbl2, keys = \"USUBJID\")) #> Error : Differences found between the objects! #> #> Summary of BASE and COMPARE #> ================================================================== #> PROPERTY BASE COMP #> ------------------------------------------------------------------ #> Name base compare #> Class \"tbl_df, tbl, data.frame\" \"tbl_df, tbl, data.frame\" #> Rows(#) 4 3 #> Columns(#) 3 3 #> ------------------------------------------------------------------ #> #> #> There are rows in BASE that are not in COMPARE !! #> ========= #> USUBJID #> --------- #> 1004 #> --------- #> #> #> Not all Values Compared Equal #> ============================= #> Variable No of Differences #> ----------------------------- #> AGE 1 #> SEX 1 #> ----------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> AGE 1002 19 18.9 #> ---------------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> SEX 1003 M #> ---------------------------------- #> #> tlb3 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1004\", 18, \"F\", \"1003\", 20, \"M\", \"1002\", 19, \"F\", \"1001\", 18, \"M\", ) # Note the sorting order of the keys is not required expect_dfs_equal(tbl1, tlb3, keys = \"USUBJID\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":null,"dir":"Reference","previous_headings":"","what":"Concatenate One or More Expressions — expr_c","title":"Concatenate One or More Expressions — expr_c","text":"Concatenate One Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concatenate One or More Expressions — expr_c","text":"","code":"expr_c(...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concatenate One or More Expressions — expr_c","text":"... One expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concatenate One or More Expressions — expr_c","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract All Symbols from a List of Expressions — extract_vars","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"Extract Symbols List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"extract_vars(x, side = \"lhs\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"x R object side One \"lhs\" (default) \"rhs\" formulas","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"library(rlang) extract_vars(exprs(PARAMCD, (BASE - AVAL) / BASE + 100)) #> [[1]] #> PARAMCD #> #> [[2]] #> BASE #> #> [[3]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1) #> [[1]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1, side = \"rhs\") #> [[1]] #> ARMCD #> #> [[2]] #> AGEGR1 #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Optional Filter — filter_if","title":"Optional Filter — filter_if","text":"Filters input dataset provided expression NULL","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optional Filter — filter_if","text":"","code":"filter_if(dataset, filter)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Optional Filter — filter_if","text":"dataset Input dataset filter filter condition. Must expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Optional Filter — filter_if","text":"data.frame containing rows dataset matching filter just dataset filter NULL","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Return English-friendly messaging for object-types — friendly_type_of","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"Return English-friendly messaging object-types","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"","code":"friendly_type_of(x, value = TRUE, length = FALSE)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"x R object. value Whether describe value x. length Whether mention length vectors lists.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"string describing type. Starts indefinite article, e.g. \"integer vector\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"helper function aids us forming user-friendly messages gets called what_is_it(), often used assertion functions identify object-type user passed argument instead expected-type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Constant Variables — get_constant_vars","title":"Get Constant Variables — get_constant_vars","text":"Get Constant Variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Constant Variables — get_constant_vars","text":"","code":"get_constant_vars(dataset, by_vars, ignore_vars = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Constant Variables — get_constant_vars","text":"dataset data frame. by_vars variables groups defined variables considered separately. .e., variable constant within group, returned. ignore_vars Variables ignore specified variables considered, .e., returned even constant (unless included variables). Permitted Values: list variable names selector function calls like starts_with(\"EX\")","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Constant Variables — get_constant_vars","text":"Variable vector.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Retrieve Dataset admiraldev_environment environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"","code":"get_dataset(name)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"name name dataset retrieve","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Sometimes, developers may want provide information users fit warning error message. example, input dataset function contains unexpected records, can stored separate dataset, users can access investigate issue. achieve , R data structure known 'environment'. environment objects created build time, can populated values package loaded update values course R session. , establishment admiraldev_environment allows us create dynamic data/objects based user-inputs need modification. purpose get_dataset retrieve datasets contained inside admiraldev_environment. Currently support two datasets inside admiraldev_environment object: one_to_many many_to_one","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Duplicates From a Vector — get_duplicates","title":"Get Duplicates From a Vector — get_duplicates","text":"Get Duplicates Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Duplicates From a Vector — get_duplicates","text":"x atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Duplicates From a Vector — get_duplicates","text":"vector type x contain duplicate values","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(1:10) #> integer(0) get_duplicates(c(\"a\", \"a\", \"b\", \"c\", \"d\", \"d\")) #> [1] \"a\" \"d\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"Get New Temporary Variable Name Dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"get_new_tmp_var(dataset, prefix = \"tmp_var\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"dataset input dataset prefix prefix new temporary variable name create","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"name new temporary variable symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"function returns new unique temporary variable name used inside dataset. temporary variable names structure prefix_n n integer, e.g. tmp_var_1. already variable inside datset given prefix suffix increased 1, e.g. tmp_var_1 already exists get_new_tmp_var() return tmp_var_2.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) tmp_var <- get_new_tmp_var(dm) mutate(dm, !!tmp_var := NA) #> # A tibble: 2 × 4 #> DOMAIN STUDYID USUBJID tmp_var_1 #> #> 1 DM STUDY X 01-701-1015 NA #> 2 DM STUDY X 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Source Variables from a List of Expressions — get_source_vars","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"Get Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"","code":"get_source_vars(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":null,"dir":"Reference","previous_headings":"","what":"Negated Value Matching — %notin%","title":"Negated Value Matching — %notin%","text":"Returns logical vector indicating match left operand right operand.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Negated Value Matching — %notin%","text":"","code":"x %notin% table"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Negated Value Matching — %notin%","text":"x values matched table values matched ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Negated Value Matching — %notin%","text":"logical vector","code":""},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Or — %or%","text":"","code":"lhs %or% rhs"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Or — %or%","text":"lhs valid R expression rhs valid R expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Or — %or%","text":"Either result evaluating lhs, rhs error","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Or — %or%","text":"function evaluates expression lhs expression results error, catches error proceeds evaluating expression rhs returns result.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks if the argument equals the auto keyword — is_auto","title":"Checks if the argument equals the auto keyword — is_auto","text":"Checks argument equals auto keyword","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks if the argument equals the auto keyword — is_auto","text":"","code":"is_auto(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks if the argument equals the auto keyword — is_auto","text":"arg argument check","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Checks if the argument equals the auto keyword — is_auto","text":"TRUE argument equals auto keyword, .e., expression symbol named auto.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is order vars? — is_order_vars","title":"Is order vars? — is_order_vars","text":"Check inputs created using exprs() calls involving desc()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is order vars? — is_order_vars","text":"","code":"is_order_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is order vars? — is_order_vars","text":"arg R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is order vars? — is_order_vars","text":"FALSE argument list order vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Is this string a valid DTC — is_valid_dtc","title":"Is this string a valid DTC — is_valid_dtc","text":"string valid DTC","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is this string a valid DTC — is_valid_dtc","text":"","code":"is_valid_dtc(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is this string a valid DTC — is_valid_dtc","text":"arg character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is this string a valid DTC — is_valid_dtc","text":"TRUE argument valid --DTC string, FALSE otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":null,"dir":"Reference","previous_headings":"","what":"Join Functions — anti_join","title":"Join Functions — anti_join","text":"*_join() functions {dplyr} without warning different attributes datasets.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Join Functions — anti_join","text":"","code":"anti_join(x, y, by = NULL, copy = FALSE, ...) inner_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...) left_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Join Functions — anti_join","text":"x data.frame y data.frame character vector copy logical ... Additional arguments suffix character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Join Functions — anti_join","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Process set_values_to Argument — process_set_values_to","title":"Process set_values_to Argument — process_set_values_to","text":"function creates variables specified set_values_to argument, catches errors, provides user friendly error messages, optionally checks type created variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"process_set_values_to(dataset, set_values_to = NULL, expected_types = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process set_values_to Argument — process_set_values_to","text":"dataset Input dataset set_values_to Variables set named list returned exprs() defining variables set, e.g. exprs(PARAMCD = \"OS\", PARAM = \"Overall Survival\") expected. values must symbols, character strings, numeric values, expressions, NA. expected_types argument specified, specified variables checked whether specified type matches type variables created set_values_to. Permitted Values: character vector values \"numeric\" \"character\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process set_values_to Argument — process_set_values_to","text":"input dataset variables specified set_values_to added/updated","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"library(dplyr) data <- tribble( ~AVAL, 20 ) try( process_set_values_to( data, set_values_to = exprs( PARAMCD = BMI ) ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = BMI)) : #> Assigning variables failed! #> • `set_values_to = exprs(PARAMCD = BMI)` #> See error message below: #> ℹ In argument: `PARAMCD = BMI`. Caused by error: ! object 'BMI' not found try( process_set_values_to( data, set_values_to = exprs( PARAMCD = 42 ), expected_types = c(PARAMCD = \"character\") ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = 42), : #> The following variables have an unexpected type: #> • PARAMCD: expected is , but it is ."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"Remove Temporary Variables Created Within Current Function Environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"remove_tmp_vars(dataset)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"dataset input dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"input dataset temporary variables removed","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) dm <- select(dm, USUBJID) tmp_var <- get_new_tmp_var(dm) dm <- mutate(dm, !!tmp_var := NA) ## This function creates two new temporary variables which are removed when calling ## `remove_tmp_vars()`. Note that any temporary variable created outside this ## function is **not** removed do_something <- function(dataset) { tmp_var_1 <- get_new_tmp_var(dm) tmp_var_2 <- get_new_tmp_var(dm) dm %>% mutate(!!tmp_var_1 := NA, !!tmp_var_2 := NA) %>% print() %>% remove_tmp_vars() } do_something(dm) #> # A tibble: 2 × 4 #> USUBJID tmp_var_1 tmp_var_2 tmp_var_3 #> #> 1 01-701-1015 NA NA NA #> 2 01-701-1016 NA NA NA #> # A tibble: 2 × 2 #> USUBJID tmp_var_1 #> #> 1 01-701-1015 NA #> 2 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Symbols in an Expression — replace_symbol_in_expr","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Replace symbols expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"replace_symbol_in_expr(expression, target, replace)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression Expression target Target symbol replace Replacing symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression every occurrence symbol target replaced replace","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Stefan Bundfuss","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"library(rlang) replace_symbol_in_expr(expr(AVAL), target = AVAL, replace = AVAL.join) #> AVAL.join replace_symbol_in_expr(expr(AVALC), target = AVAL, replace = AVAL.join) #> AVALC replace_symbol_in_expr(expr(desc(AVAL)), target = AVAL, replace = AVAL.join) #> desc(AVAL.join)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Expression Value with Name — replace_values_by_names","title":"Replace Expression Value with Name — replace_values_by_names","text":"Replace Expression Value Name","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"replace_values_by_names(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Expression Value with Name — replace_values_by_names","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Expression Value with Name — replace_values_by_names","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"library(rlang) replace_values_by_names(exprs(AVAL, ADT = convert_dtc_to_dt(EXSTDTC))) #> [[1]] #> AVAL #> #> $ADT #> ADT #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Single Quotes — squote","title":"Wrap a String in Single Quotes — squote","text":"Wrap String Single Quotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Single Quotes — squote","text":"","code":"squote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Single Quotes — squote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Single Quotes — squote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":null,"dir":"Reference","previous_headings":"","what":"Suppress Specific Warnings — suppress_warning","title":"Suppress Specific Warnings — suppress_warning","text":"Suppress certain warnings issued expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Suppress Specific Warnings — suppress_warning","text":"","code":"suppress_warning(expr, regexpr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Suppress Specific Warnings — suppress_warning","text":"expr Expression executed regexpr Regular expression matching warnings suppress","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Suppress Specific Warnings — suppress_warning","text":"Return value expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Suppress Specific Warnings — suppress_warning","text":"warnings issued expression match regular expression suppressed.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":null,"dir":"Reference","previous_headings":"","what":"Valid Time Units — valid_time_units","title":"Valid Time Units — valid_time_units","text":"Contains acceptable character vector valid time units","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Valid Time Units — valid_time_units","text":"","code":"valid_time_units()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Valid Time Units — valid_time_units","text":"character vector valid time units","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn a List of Expressions into a Character Vector — vars2chr","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"Turn List Expressions Character Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"vars2chr(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"expressions list expressions created using exprs()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) vars2chr(exprs(USUBJID, AVAL)) #> #> \"USUBJID\" \"AVAL\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn if incomplete dtc — warn_if_incomplete_dtc","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"Warn incomplete dtc","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"","code":"warn_if_incomplete_dtc(dtc, n)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"dtc character vector date-times ISO 8601 format n non-negative integer","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"warning dtc contains partial dates","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"Checks two list inputs names number elements issues warning otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"warn_if_inconsistent_list(base, compare, list_name, i = 2)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"base named list compare named list list_name string name list index id compare 2 lists","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"warning 2 lists different names length","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) # no warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) # warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ, DTHVAR = \"text\"), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) #> Warning: The variables used for traceability in `Test` are not consistent, please check: #> source 1 , Variables are given as: DTHDOM DTHSEQ DTHVAR #> source 2 , Variables are given as: DTHDOM DTHSEQ"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"Warn vector contains unknown datetime format \"2003-12-15T-:15:18\", \"2003-12-15T13:-:19\",\"–12-15\",\"—–T07:15\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"warn_if_invalid_dtc(dtc, is_valid = is_valid_dtc(dtc))"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"dtc character vector containing dates is_valid logical vector indicating whether elements dtc valid","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"## No warning as `dtc` is a valid date format warn_if_invalid_dtc(dtc = \"2021-04-06\") ## Issues a warning warn_if_invalid_dtc(dtc = \"2021-04-06T-:30:30\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Variable Already Exists — warn_if_vars_exist","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"Warn variable already exists inside dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"warn_if_vars_exist(dataset, vars)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"dataset data.frame vars character vector columns check dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~USUBJID, ~ARM, \"01-701-1015\", \"Placebo\", \"01-701-1016\", \"Placebo\", ) ## No warning as `AAGE` doesn't exist in `dm` warn_if_vars_exist(dm, \"AAGE\") ## Issues a warning warn_if_vars_exist(dm, \"ARM\") #> Warning: Variable \"ARM\" already exists in the dataset."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":null,"dir":"Reference","previous_headings":"","what":"What Kind of Object is This? — what_is_it","title":"What Kind of Object is This? — what_is_it","text":"Returns string describing kind object input .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"What Kind of Object is This? — what_is_it","text":"x R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"What Kind of Object is This? — what_is_it","text":"character description type x","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(\"abc\") #> Warning: `what_is_it()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.obj_type_friendly {letters}}')`. #> [1] \"`\\\"abc\\\"`\" what_is_it(1L) #> [1] \"`1`\" what_is_it(1:10) #> [1] \"an integer vector\" what_is_it(mtcars) #> [1] \"a data frame\""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-development-version","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev (development version)","text":"New Function deprecate_inform() wrapper around lifecycle::deprecate_soft() allow control messaging. (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-development-version","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev (development version)","text":"Objects passed assert_list_element() via ... argument can now used glue expression specified message_text argument. (#469) required_unit argument assert_unit() enhanced. now possible specify one unit specify . latter case uniqueness unit checked. (#468) assert_numeric_vector() function gained optional length argument check whether vector specific length. (#473)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-development-version","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev (development version)","text":"admiraldev compatible R version >=4.1 (#456) following function arguments entering next phase deprecation process: (#459) Phase 1 (message) functions arguments Phase Phase 2 (warning) functions arguments Phase Phase 3 (error) functions arguments Phase Phase 4 (removed) argument quosures removed functions vars2chr(quosures), replace_values_by_names(quosures), get_source_vars(quosures) Removed v1.0.0 assert_named_expr() Removed v1.0.0 assert_has_variables() Removed v1.0.0 assert_function_param()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-development-version","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev (development version)","text":"Deprecation Strategy updated long haul! (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-development-version","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev (development version)","text":"devcontainer files removed (#480)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-110","dir":"Changelog","previous_headings":"","what":"admiraldev 1.1.0","title":"admiraldev 1.1.0","text":"CRAN release: 2024-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.1.0","text":"Updated arg_name parameter assert_filter_cond, assert_symbol, assert_expr gsub(\"^enexpr\\\\((\\\\w+)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)) argument error messages return quoted argument without enexpr(), e.g. filter_add instead enexpr(filter_add). (#2404) Error messaging throughout package updated rlang::abort() cli::cli_abort(). part update, assert_*() functions new arguments assert_*(message, arg_name, call, class). (#367) Warning messaging also updated use cli messaging.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.1.0","text":"renv related files removed. (#360) longer exporting is_named() function. (#401) pharmaversesdtm removed dependency. (#434) part error messaging update, following changes made. assert_s3_class(class) argument renamed assert_s3_class(cls). (#367) Functions arg_name(), enumerate(), what_is_it(), friendly_type_of() deprecated warning returned developer using functions. developer functions (opposed functions typical admiral users), use short deprecation cycle.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.1.0","text":"“Release Strategy” vignette updated respect new branching strategy. (#353) “Release Strategy” vignette now contains short new “Release Tracking” section linking external dashboard CRAN packages awaiting release. (#358)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-1-1-0","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev 1.1.0","text":"Removed dependencies needed build package package documentation. (#426) Increased minimum R version required 4.0 match {admiral}. (#382) addin_format_testthat addin moved {pharmaverse4devs} package. (#419)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-100","dir":"Changelog","previous_headings":"","what":"admiraldev 1.0.0","title":"admiraldev 1.0.0","text":"CRAN release: 2023-12-15","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-0-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.0.0","text":"assert_function() now accepts function arguments ellipsis, ... function formals (#339)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.0.0","text":"assert_function_param() assert_named_expr() assert_has_variables()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-0-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.0.0","text":"New documentation programming strategy around quoting/expressions standardizing roxygen texts (#233, #332) New documentation use footnotes writing vignettes (#324) Updated language images adopt GitHub Flow Strategy (#349)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-050","dir":"Changelog","previous_headings":"","what":"admiraldev 0.5.0","title":"admiraldev 0.5.0","text":"CRAN release: 2023-09-11","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-5-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.5.0","text":"Calls admiral.test swapped pharmaversesdtm (#321) New vignette package writing extensions now available (#295, #312) New vignette creating test data now available (#282)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-5-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.5.0","text":"messaging warn_if_invalid_dtc() updated align date/datetime functions admiral currently . (#316)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.5.0","text":"assert_order_vars() quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names(), get_source_vars(), vars2chr(). (#288) assert_function_param() deprecated favor assert_function(). (#264) assert_named_expr() deprecated favor assert_expr_list(). (#264) assert_has_variables() deprecated favor assert_data_frame(). (#264)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-5-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.5.0","text":"Guidance around issues merging updated (#286) Common R CMD troubleshooting made separate vignette (#286) Documentation get_dataset() improved. (#271) Minor updates programming strategy added (#213, #240, #260) Updated unit testing vignette snapshot testing guidance. (#302) Documentation friendly_type_of() provided (#22) Minor updates pull request review guidance added (#201, #292) Documentation singular versus plural function argument names added programming strategy vignette. Also documentation common arguments missing_value missing_values added. (#296) Documentation highlighting difference set_values_to keep_source_vars (#318) List common arguments updated (#306)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-040","dir":"Changelog","previous_headings":"","what":"admiraldev 0.4.0","title":"admiraldev 0.4.0","text":"CRAN release: 2023-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-4-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.4.0","text":"New function assert_named() check elements argument named (#241) New function assert_expr_list() check argument list expressions (#241) Added Report bug link admiraldev website (#257)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.4.0","text":"assert_order_vars() deprecated favor assert_expr_list(). (#241) following functions deprecated previous admiral versions using next phase deprecation process: (#272) quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names().","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-4-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.4.0","text":"deprecation strategy updated regarding unit tests deprecated functions/arguments phase 1. (#247) programming strategy updated regarding permitted values calling functions package dependencies (#72, #253)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-030","dir":"Changelog","previous_headings":"","what":"admiraldev 0.3.0","title":"admiraldev 0.3.0","text":"CRAN release: 2023-03-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-3-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.3.0","text":"New function process_set_values_to() creating variables specified set_value_to argument catching errors (#70)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-3-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.3.0","text":"Using testthat3e (testthat 3rd edition) unit testing. stricter messages must addressed deprecated functions throw errors. (#230) Slight boost test coverage dev_utilities (#102) Fix datatable styling documentation (#197) assert_character_vector() function gained named argument check elements vector named. (#70) assert_list_of() function gained named argument check elements list named. (#203) quote_fun argument enumerate() extended NULL can specified request quoting elements. (#203) assert_list_of() function enhanced also considers type element, e.g., check value list symbols. (#208)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.3.0","text":"default value optional argument assert_date_vector(), assert_list_of(), assert_s3_class() changed TRUE FALSE make default behavior consistent. (#87) quo_c() replace_symbol_in_quo() quosures argument get_source_vars(), replace_values_by_names(), vars2chr()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-3-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.3.0","text":"New section programming strategy regarding comments (#71) Removed requirement add @author tags code scripts programming strategy, tracking authors DESCRIPTION file. Authors removed function documentation line update. (#206, #210) Removed -boarding Issue Template (#225) Increased clarity scope package (#232)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-020","dir":"Changelog","previous_headings":"","what":"admiraldev 0.2.0","title":"admiraldev 0.2.0","text":"CRAN release: 2022-11-30","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.2.0","text":"Developer addin formatting tests admiral programming standards (#73) New functions replace_symbol_in_quo() add_suffix_to_vars() (#106) New function assert_atomic_vector() (#98) New keyword/family create_aux functions creating auxiliary datasets (#126) New function assert_date_vector() (#129) New function assert_same_type() (#176) Remove dependency {assertthat} (#149) Test coverage admiraldev increased 45% approximately 100% (#94, #95, #96, #98, #101, #103) Environment objects consolidated single admiraldev_environment object R/admiraldev_environment.R. (#179)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.2.0","text":"expect_names argument added assert_vars() check variables named (#117) Remove dplyr function exports migration user facing function negate_vars() admiral (#83)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.2.0","text":"longer compatible admiral (<0.9)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.2.0","text":"New vignette package release strategy (#79) Updated multiple roxygen headers (#116, #133, #134, #141, #145, #172) Description admiral options work certain function inputs, .e subject_keys (#133)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-2-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.2.0","text":"PR Checklist Template updated (#172) New authors/contributors (#158)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-010","dir":"Changelog","previous_headings":"","what":"admiraldev 0.1.0","title":"admiraldev 0.1.0","text":"CRAN release: 2022-08-26","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-1-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.1.0","text":"Developer specific functions brought admiral Developer specific vignettes brought admiral New admiraldev website created","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-1-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.1.0","text":"NA","code":""}] +[{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Version 2.0, January 2004 ","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_1-definitions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"1. Definitions","title":"Apache License","text":"“License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_2-grant-of-copyright-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"2. Grant of Copyright License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_3-grant-of-patent-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"3. Grant of Patent License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_4-redistribution","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"4. Redistribution","title":"Apache License","text":"may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: () must give recipients Work Derivative Works copy License; (b) must cause modified files carry prominent notices stating changed files; (c) must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; (d) Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_5-submission-of-contributions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"5. Submission of Contributions","title":"Apache License","text":"Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_6-trademarks","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"6. Trademarks","title":"Apache License","text":"License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_7-disclaimer-of-warranty","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"7. Disclaimer of Warranty","title":"Apache License","text":"Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_8-limitation-of-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"8. Limitation of Liability","title":"Apache License","text":"event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_9-accepting-warranty-or-additional-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"9. Accepting Warranty or Additional Liability","title":"Apache License","text":"redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"appendix-how-to-apply-the-apache-license-to-your-work","dir":"","previous_headings":"","what":"APPENDIX: How to apply the Apache License to your work","title":"Apache License","text":"apply Apache License work, attach following boilerplate notice, fields enclosed brackets [] replaced identifying information. (Don’t include brackets!) text enclosed appropriate comment syntax file format. also recommend file class name description purpose included “printed page” copyright notice easier identification within third-party archives.","code":"Copyright 2021 F. Hoffmann-La Roche AG and GlaxoSmithKline LLC Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"dear-developers","dir":"Articles","previous_headings":"","what":"Dear Developers","title":"Get Started","text":"admiraldev set tools intended , developer, help make developing within admiral family easier, consistently robust across packages maybe even fun! Tools loosely defined follows: Utility Functions used admiral admiral extension functions custom checks providing custom messages, warnings errors. custom messages, warnings errors succinct, helpful messaging around function expects inputs. inputs admiral functions many, generally fit three categories: datasets, variables arguments. functions start assert_, is_ get_. Utility functions help documentation, testing checking health code base admiral packages. Vignettes working admiral functions, developing unit testing, releases process, vignette writing documentation needs. vignettes intended use across admiral packages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"why-have-a-separate-development-package","dir":"Articles","previous_headings":"","what":"Why have a separate development package?","title":"Get Started","text":"admiral package function base grown decided create extension packages use within companies specific TAs help specific problems. intended extension packages follow processes admiral core, e.g. Unit Testing, Roxygen Documentation, Function Design. standalone development package allows us keep date development process developers across family. also feel lot developer functions user-specific gives us freedom create release utility tools specific family packages reduces non-user facing functions within admiral family packages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"how-to-add-new-tools-to-admiraldev","dir":"Articles","previous_headings":"","what":"How to add new tools to {admiraldev}?","title":"Get Started","text":"Just like admiral, follow procedures adding issues discuss feature requests, bugs documentation updates. develop issues branches Pull Request Code Review. Experimental tools highly encouraged help reduce repetitive patterns automating boring stuff.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"scenario-one-admiral-core","dir":"Articles","previous_headings":"When to add a function to {admiraldev}?","what":"Scenario One: {admiral} core","title":"Get Started","text":"developer working admiral core implements new type derivation function BDS-Findings ADaM dataset. new derivation function two new assert custom checking functions inputs well helper function. Loose guidelines: derivation function always live admiral core. helper function looked see made available within admiraldev extension packages needs reduce repetitive coding across family admiral. generalized, remain admiral. assert custom checking functions always live within admiraldev stay family assertion functions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"scenario-two-admiral-extension","dir":"Articles","previous_headings":"When to add a function to {admiraldev}?","what":"Scenario Two: {admiral} extension","title":"Get Started","text":"developer working admiralonco implements new type derivation function adding certain parameters oncology specific ADaM dataset. new derivation function one new assert custom checking function. Loose guidelines: derivation function closely looked see can generalized ADaM datasets. case, moved admiral core. function specific oncology needs, remain admiralonco. assert custom checking functions follow similar principle - can generalized therapeutic areas move admiraldev, whereas specific oncology needs, remain admiralonco.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Guidance for git and GitHub Usage","text":"article give overview admiral project utilizing version-control software git website GitHub working RStudio. go primary branches house source code admiral project well use Feature branches address Issues. Issues can range bugs enhancements identified requested developers, users testers. also provide bare minimum git commands needed get running. Please refer Resource section -depth guidance using git GitHub.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"branches","dir":"Articles","previous_headings":"","what":"Branches","title":"Guidance for git and GitHub Usage","text":"main branch contains latest development version package. can find released versions gh-pages branches contains code used render R package websites - looking right now! patch branch reserved special hot fixes address bugs rarely used. info Hot Fix Release main, gh-pages, patch branches protection. try push changes branches get error unless administrator. Feature branches actual development related specific issue happens. Feature branches merged main pull request merged. Check Pull Request Review Guidance guidance merging main.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"working-with-feature-branches","dir":"Articles","previous_headings":"","what":"Working with Feature Branches","title":"Guidance for git and GitHub Usage","text":"Feature Branches developers work addressing Issues.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"implementing-an-issue","dir":"Articles","previous_headings":"Working with Feature Branches","what":"Implementing an Issue","title":"Guidance for git and GitHub Usage","text":"feature branch must related issue. encourage new developers work one issue time.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"naming-branches","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Naming Branches","title":"Guidance for git and GitHub Usage","text":"name branch must prefixed issue number, followed short meaningful description. example, given issue #94 “Program function derive LSTALVDT”, branch name 94_derive_var_lstalvdt.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"create-a-new-feature-branch-from-the-terminal-from-main","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Create a New Feature Branch from the Terminal (from main)","title":"Guidance for git and GitHub Usage","text":"Checkout main branch: git checkout main Pull latest changes GitHub: git pull Create new branch main branch switch : git checkout -b ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"create-a-new-feature-branch-from-github-from-main","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Create a New Feature Branch from GitHub (from main)","title":"Guidance for git and GitHub Usage","text":"can also create feature branch GitHub. Switch main branch Type new feature branch name Click Create branch: @main main Sure Pull newly created branch RStudio","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"commits-from-the-terminal-in-rstudio","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Commits from the Terminal in RStudio","title":"Guidance for git and GitHub Usage","text":"start commit process, need tell git move changes staging area. Use git add move changes staging area wait next commit. can use git add . move files worked staging area. Next can commit, takes snapshot staged changes. committing, prefix message issue number add meaningful message git commit –m '#94 last alive date implementation'. Lastly, push changes GitHub using git push origin ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"commits-from-the-git-tab-in-rstudio","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Commits from the Git Tab in RStudio","title":"Guidance for git and GitHub Usage","text":"can also make use Git Tab within RStudio commit changes. benefit using Tab able see changes file red green highlighting. Just like terminal, start message issue number add meaningful succinct sentence. Hit Commit button Push GitHub.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"commit-message-etiquette","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Commit Message Etiquette","title":"Guidance for git and GitHub Usage","text":"require developers insert issue number commit message. Placing issue number commit message allows reviewers quickly find discussion surrounding issue. pushed GitHub issue number hyperlinked issue tracker, powerful tool discussion traceability, think valuable highly regulated industry like Pharma. styles commit messaging permitted:","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"style-1","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Style 1:","title":"Guidance for git and GitHub Usage","text":"feat: #94 skeleton function developed chore: #94 styler lintr update docs: #94 parameters details sections compelted","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"style-2","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Style 2:","title":"Guidance for git and GitHub Usage","text":"#94 skeleton function developed #94 styler lintr update #94 parameters details sections compelted","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"style-3","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Style 3:","title":"Guidance for git and GitHub Usage","text":"skeleton function developed (#94) styler lintr update (#94) parameters details sections compelted (#94)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"pull-request","dir":"Articles","previous_headings":"Working with Feature Branches","what":"Pull request","title":"Guidance for git and GitHub Usage","text":"recommend thorough read articles, Pull Request Review Guidance Programming Strategy -depth discussions proper Pull Request.Pull Request authors benefit shorter review times closely following guidance provided two articles. discuss simple git commands terminal GitHub Pull Request. recommend Pull Request GitHub terminal. changes committed, push updated branch GitHub:git push -u origin GitHub, Pull requests, user either “Compare pull request” button /“Create Pull Request”. first button created GitHub detects recent changes made. branch merge must main branch (base = main) compare branch new branch merge - shown picture. Please pay close attention branch merging ! issue must linked pull request “Development” field Pull Request. cases, linkage automatically close issue move Done column project board. completed Pull Request see committed changes available reviewer. reviewer must specified Pull Request. recommended write brief summary reviewers can quickly come speed Pull Request. Images updates nice , easy GitHub! Use Screen Capture software Copy Paste summary.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"reviewingclosing-an-issue","dir":"Articles","previous_headings":"Working with Feature Branches > Pull request","what":"Reviewing/Closing an Issue","title":"Guidance for git and GitHub Usage","text":"least one reviewer must approve Pull Request. Please review Pull Request Review Guidance, provides depth guidance proper Pull Request. reviewer must ensure function follows programming strategy recommendations. comment/question/discussion must addressed documented GitHub Pull Request merged review completed, reviewer merge Pull Request feature branch automatically deleted. merging Pull Request please check corresponding moved done column Project Board. Also, please make sure issue closed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"solving-merge-conflicts-in-the-terminal-on-rstudio","dir":"Articles","previous_headings":"Working with Feature Branches > Pull request","what":"Solving Merge Conflicts in the Terminal on RStudio","title":"Guidance for git and GitHub Usage","text":"Merge conflict situation git decide changes apply since multiple updates part file. typically happens multiple people update part code. conflicts always need handled manually (code updates may required): provides list files conflicts file conflicts conflicting sections marked <<<<<<<, =======, >>>>>>>. code markers must updated markers removed. Source files need updated manually. Generated files like NAMESPACE generated documentation files updated manually recreated source files updated. make changes available call:","code":"git checkout main git pull git checkout git merge main git add git commit -m \"\" git push"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"solving-merge-conflicts-in-github","dir":"Articles","previous_headings":"Working with Feature Branches > Pull request","what":"Solving Merge Conflicts in GitHub","title":"Guidance for git and GitHub Usage","text":"simple merge conflicts, developers can make use GitHub interface solve . GitHub show number conflicts two branches. image, GitHub found 3 conflicts, display first one. Just like terminal, GitHub make use <<<<<<<, =======, >>>>>>> highlight conflicting sections. need make decision whether keep code base feature branch. decided, go code remove section longer wish keep. sure remove <<<<<<<, =======, >>>>>>> well! work conflicts mark Resolved Commit changes. recommended pull branch back RStudio make sure untoward effects happen branch.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"useful-git-commands","dir":"Articles","previous_headings":"Working with Feature Branches","what":"Useful git Commands","title":"Guidance for git and GitHub Usage","text":"merging: git merge - merge my_branch current branch stashing commands useful one wants go back clean directory git stash - stash (store) current changes restore clean directory git stash pop - put back (restore) stashed changes git revert also helpful ? Using code unmerged branches Checkout unmerged branch want use: git checkout Pull latest committed changes unmerged branch: git pull Check feature branch: git checkout Merge unmerged branch : git merge ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"github_resources","dir":"Articles","previous_headings":"","what":"Resources on using git, GitHub and RStudio","title":"Guidance for git and GitHub Usage","text":"GitHub RStudio Happy Git GitHub useR","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/package_extensions.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Package Extensions","text":"admiral made family packages foresee growing time cover specific areas TA (Therapeutic Area) package extensions, wider range companies individuals getting board join development efforts. step--step guidance talks recommendations new development teams go creating package extensions. critical guidance followed, users need feel consistent experience working across admiral packages. admiral package extension doesn’t follow conventions wouldn’t include pharmaverse part admiral family.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/package_extensions.html","id":"step-by-step-guidance-to-create-a-package-extension","dir":"Articles","previous_headings":"","what":"Step-by-step Guidance to Create a Package Extension","title":"Package Extensions","text":"Note: ordering numbers suggested don’t need strictly followed sequence. Raise need new admiral package extension pharmaverse Slack channel, directly admiral package maintainer. naming convention needs {admiralxxx} request scope targeted overly narrow, example instead package extension HIV ’d prefer one across virology. Otherwise number packages may become unmanageable. agreed, reach company contacts working similar areas see collaborative development can achieved. recommendation always target least 2 companies start implementation remains robust protect going company-specific route. However, consider 4 5 companies get involved early may slow decision-making. companies agree co-develop, identify lead . One company act driver overall package extension put forward product owner technical lead ultimately final say contentious decisions. product owner cover project decisions (e.g. around scope priorities), whereas technical lead cover technical decisions (e.g. around design implementation). technical lead either: ) already significantly involved admiral core development team developer/contributor, b) join core development team simultaneously. ensure design kept true manifesto consistent style quality respect admiral standards. Agree charter expectations company, e.g. usually ask least 3 developers least 25% capacity mix R, GitHub TA experience. Within charter make sure scope timelines clear. important try boil ocean. Focus first common endpoints required foundation package can build via contributions co-development companies also wider across-industry admiral community. useful, admiralonco charter shared guide. company start identify required developer resources. developer required complete {admiral} dummy issue onboarding, well reading admiraldev documentation, - especially developer guides, need followed package extensions. Optionally can useful host kick-meeting decide team work, recommend agile/scrum practices. Set “admiralxxx_dev” channel Slack add team members informal team chat, agree way share working documents across co-development team. recommend use new folder pharmaverse MS Teams - Michael Rimler (michael.s.rimler@gsk.com) help rep PHUSE board. useful starter development activity look pharmaversesdtm check test data sufficient TA needs, e.g. admiralonco generate new test data SDTM domains RS TU. Note personal data used (even anonymized) important keep data generated -line CDISC pilot data use , .e. use USUBJIDs DM etc. Optionally draft, agree sign collaboration agreement collaborating companies wish, useful protecting secondary IP company standard specifications may shared within team. example stored , work Legal teams required. Share company-specific implementations specifications able harmonize design strategy package extension. important remain pragmatic consider higher perspective one company. Engage company standards representatives find discrepancies across company approaches question really need things differently (health authorities patients benefit ?). Also consider always expect level company-specifics covered internal company package extensions. Set new public GitHub repo pharmaverse org using admiraltemplate - includes set-pieces (CI/CD checks issue/PR templates) enable package stay consistent others admiral family, well core package dependencies versions. See {admiraltemplate} Quick Start Guide Note step requires org member access granted pharmaverse council reps, admins org. Also free add additional package dependencies needed assuming reliable packages used, must depend newer versions packages (always reply “” updates suggested installation). repo available technical lead granted admin access repo set GitHub team name package extension assign required access co-development team members. require write access, may choose give leads admin access well never bottle-neck waiting one person. Update template license file repo adding co-development company names place Roche & GSK - admiral package extensions use Apache 2.0, preferred permissive license. Agree co-development companies required extra wording copyright/IP section. Set project board, , help manage backlog. Assuming work agile/scrum, create product backlog, prioritize make sprint plan. intention always re-use much possible admiral core package. find anything additional needed package extension, first question whether might common need TAs consider instead raising issue admiral core. designing new functions always try stay aligned Programming Strategy. Start development foundational first release 0.1.0. Follow consistent Development Process admiral. Line testers companies others set expectations around believe stable version available user testing. can use admiral Slack community raise interest get involved. Add pharmaverse badge README: https://pharmaverse.org/contribute/badges/ - needs support pharmaverse council rep. Raise admiral repo issue ensure package extension site linked core admiral site .` important admiral family packages keep similar release schedule cadence, order ease adoption users give clear expectations. admiral core package cadence releases one every quarter fixed schedule (every first Monday last month quarter - March, June, September, December). core package set release schedule package extensions follow, .e. admiral releases ’d expect package extension releases targeted within 2 week window. releases communicated via Slack channel well quarterly user community meetings. happy package extension well tested sufficient state make submission CRAN. technical lead named maintainer. CRAN release, advertise via Slack & LinkedIn. Plan future enhancements make issues. team feels ready can open development contributions wider community - see page. Please use good first issue (ideal new starters) & help wanted (ideal experienced contributors) issue labels. Note: core admiral team carry periodic reviews extension package contents ensure nothing duplicated ensure standards best practices followed. frequency reviews agreed upon technical leads core extension packages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/package_extensions.html","id":"lessons-learned","dir":"Articles","previous_headings":"","what":"Lessons Learned","title":"Package Extensions","text":"lessons learned previous package extensions: Since ADaM conceived TA-agnostic, TA standards can widely differ across companies, TA package extensions shouldn’t contain many new functions. , functionality required create ADaM present admiral, localized limited exceptions truly TA-specific variables/endpoints. , R folder package extensions relatively lean! Connected , package extension just R functions - also vignettes examples template programs. fact, just important R functions , users turn guidance. Making sure package always --date respect new admiral releases (e.g. due deprecation functions) crucial task. Maintaining package long-term way ensure success. Beware developing just sake developing! may find reach point stasis extension package journey, much need new development. case, vital avoid working tangential tasks. Instead, focus ensuring existing fit--purpose possible.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Pull Request Review Guidance","text":"document intended guidance creators reviewers pull requests (PRs) admiral package family. PR authors benefit shorter review times closely following guidance provided . pull request main branch signifies issue “addressed”. issue might bug, feature request documentation update. Pull Request merged main branch, issue(s) can closed. Closely following guidance ensure “addressed” issues auto-close merge main.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"review-criteria","dir":"Articles","previous_headings":"","what":"Review Criteria","title":"Pull Request Review Guidance","text":"pull request merged main needs pass automated CI checks appear bottom Pull Request. addition, PR creator reviewer make sure Programming Strategy Development Process followed function ADaM IG compliant function intended (described header corresponding issue) function header properly explains intention function, expected inputs (incl. permitted values parameters) output produced; reading documentation reader able predict output function without read source code function accompanying set unit tests; derivations unit test code coverage least 90%; whole package coverage >= 80% implemented derivation scope admiral, e.g. expect company specific input hard-code company-specific rules meaningful error warning messages issued input invalid documentation created/updated running devtools::document() functions supposed exported listed NAMESPACE file; requires @export tag function header examples print relevant source variables newly created variables /records output NEWS.md file updated entry explains new features changes change user-specific warrants mention development milestone files affected implemented changes, e.g. vignettes templates, updated","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"codeowners-and-pr-guidance","dir":"Articles","previous_headings":"Review Criteria","what":"Codeowners and PR Guidance","title":"Pull Request Review Guidance","text":"creator PR, assignment reviewer can unclear. PRs, feel free select members core development team. individuals scan repository regular basis well may provide /review even originally included selected reviewer. Sometimes, development function vignette falls specific-topic, e.g. labs PK/PD. Please ensure include appropriate reviewer modifying files rely domain-expertise. try maintain active list domain-specific topics automatically tag appropriate reviewer using CODEOWNERS file, located .github folder. interested codeowner, reach development team.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"so-much-red-tape","dir":"Articles","previous_headings":"","what":"So much Red Tape!","title":"Pull Request Review Guidance","text":"admiral development team aware sympathetic great many checks, processes documents needed work order compliant Pull Request. task-list-completed GitHub workflow created help reduce burden contributors providing standardized checklist compiles information Pull Request Review Guidance, Programming Strategy Development Process vignettes. next three sections give high-level overview contributor faces opening PR, contributor interacts task-list-completed workflow PR.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"open-a-pull-request","dir":"Articles","previous_headings":"So much Red Tape!","what":"Open a Pull Request","title":"Pull Request Review Guidance","text":"contributor opens PR lengthy standard text inserted comment section. Please alter automated text. need manually add Closes # title Pull Request. can use Edit button top right forget step start Pull Request. Besides free add additional textual information, screenshots, etc. bottom automated text needed clarify contribute discussion around PR.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"create-a-pull-request","dir":"Articles","previous_headings":"So much Red Tape!","what":"Create a Pull Request","title":"Pull Request Review Guidance","text":"click green Create pull request button automated text inserted turned checklist Pull Request. check box drawn previously mentioned vignettes presented recommended sequence. check boxes meant helpful aid ensuring created compliant Pull Request.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"complete-the-pull-request-checklist","dir":"Articles","previous_headings":"So much Red Tape!","what":"Complete the Pull Request checklist","title":"Pull Request Review Guidance","text":"check boxes linked task-list-completed workflow. need check box acknowledgment done due diligence creating compliant Pull Request. GitHub refresh Pull Request trigger task-list-completed workflow completed task. PR can merged main contributor checked check box items. Please don’t hesitate reach admiral team Slack GitHub Issues tracker think checklist needs amended clarity needed check box item. Note Reviewers: recommend use Squash Merge merging Pull Request. create clean commit history.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"github-actionsci-workflows","dir":"Articles","previous_headings":"","what":"GitHub Actions/CI Workflows","title":"Pull Request Review Guidance","text":"task-list-completed workflow one several workflows/actions used within admiral. workflows live .github/workflows folder important understand use remedy workflow fails. Workflows defined responsible assuring high package quality standards without compromising performance, security, reproducibility.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"a-synopsis-of-admirals-workflows","dir":"Articles","previous_headings":"GitHub Actions/CI Workflows","what":"A synopsis of admiral’s workflows","title":"Pull Request Review Guidance","text":"recommend checking README admiralci repository gain understanding workflows/actions used admiral.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Programming Strategy","text":"admiral intended contributed user community, article meant developers want either expand admiral functionalities build top admiral. order keep framework robust across whole community, defined programming strategy followed cases. contributions include, example, company specific derivations ADaM datasets.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"functional-workflow","dir":"Articles","previous_headings":"","what":"Functional Workflow","title":"Programming Strategy","text":"Overall programming follow functional approach. mandate use tidyverse (e.g. dplyr) similar functionality existing base R ADaM dataset built set functions free flow code. ADaM dataset specific programming workflow. function specific purpose supports ADaM Dataset programming workflow. admiral function company specific function. Admiral functions can re-used company specific functions. function belongs one category defined keywords/family. function used derive one multiple variable(s) required unit tested. Functions standard naming convention. Double coding used QC method (absolutely necessary). ADaMs created readable, submission-ready code.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-design","dir":"Articles","previous_headings":"Functions in R","what":"Function Design","title":"Programming Strategy","text":"Firstly, important explain decide need new derivation functions. derivation rule algorithm common highly similar across different variables/parameters (e.g. study day duration) provide generic function can used satisfy times may needed across different ADaMs. Similarly, feel certain derivation useful beyond single purpose also provide generic function (e.g. instead last known alive date function, extreme date function user find last date selection, example first). Otherwise, feel derivation rule unique need sufficiently complex justify opt dedicated function specific variable/parameter (e.g. treatment-emergent flag AEs). certain variables closely connected (e.g. imputed date corresponding imputation flag) single function provide variables. something needed ADaM achieved simply via existing tidyverse function, wrap admiral function, add unnecessary extra layer users. following principles key designing new function: Modularity - code follows modular approach, .e. steps must clearly separated dedicated purpose. applies scripts creating dataset module create single variable parameter. also complex derivations several steps. Commenting steps key readability. Avoid Copy Paste - similar code used multiple times, put separate function. improves readability maintainability makes unit testing easier. done every simple programming step tidyverse can used. rather computational functions data checks. However, also consider nest many functions. Checks - Whenever function fails, meaningful error message must provided clear reference input caused failure. users dig detailed code want apply function. meaningful error message supports usability. Flexibility - Functions flexible possible long reduce usability. example: source variables newly created variables conditions selecting observations hard-coded. useful argument triggers optional steps, e.g. filter argument specified, input dataset restricted, otherwise step skipped. However, arguments trigger completely different algorithms. example BNRIND derived based BASE based ANRIND. implemented within one function algorithms completely different. BASE used, values categorized ANRIND used, values merged baseline observation.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"input-output-and-side-effects","dir":"Articles","previous_headings":"Functions in R","what":"Input, Output, and Side-effects","title":"Programming Strategy","text":"behavior function determined input, global object, .e. input like datasets, variable names, options, … must provided function arguments. expected input datasets grouped. grouped, function must issue error. function requires grouping, function must provide by_vars argument. output dataset must ungrouped. functions sort (arrange) output dataset end. function needs create temporary variables input dataset, names variables must generated get_new_tmp_var() avoid variables input dataset accidentally overwritten. temporary variables must removed output dataset calling remove_tmp_vars(). developers find need use create environment objects achieve flexibility, use admiral_environment environment object created admiral_environment.R. objects stored environment must documented admiral_environment.R. equivalent environment object .R file exist admiraldev well. details environments work, see relevant sections environments R Packages Advanced R textbooks. general, function must side-effects like creating modifying global objects, printing, writing files, …","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"admiral-options","dir":"Articles","previous_headings":"Functions in R","what":"Admiral Options","title":"Programming Strategy","text":"exception made admiral options, see get_admiral_option() set_admiral_options(), certain pre-defined defaults added flexibility allow user-defined defaults commonly used function arguments e.g. subject_keys currently pre-defined exprs(STUDYID, USUBJID), can modified using set_admiral_options(subject_keys = exprs(...)) top script. reasoning behind relieve user repeatedly changing aforementioned commonly used function arguments multiple times script, may called across many admiral functions. additional flexibility needs added another commonly used function argument e.g. future_input set exprs(...) can added admiral option. function formals define future_input = get_admiral_option(\"future_input\") proceed modify body roxygen documentation set_admiral_options().","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-names","dir":"Articles","previous_headings":"Functions in R","what":"Function Names","title":"Programming Strategy","text":"Function names start verb use snake case, e.g. derive_var_base(). Please note appropriate var/vars prefix used cases function creates variable(s), regardless presence new_var argument function call. Oftentimes creating new derive_var derive_param function may sort non-trivial calculation involved may want write customized function . creating compute_ function becomes appropriate, calculation portion contained one step part overall derive_ function, reducing clutter main function body assisting debugging. addition, compute_ function implemented calculation used one derivation. example compute_bmi() used derive baseline BMI variable ADSL (based baseline weight baseline height variables) also used derive BMI parameter ADVS (based weight height parameters). Please see compute_age_years() derive_var_age_years() another example.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-arguments","dir":"Articles","previous_headings":"Functions in R","what":"Function Arguments","title":"Programming Strategy","text":"default value optional arguments NULL. recommended argument order contributors asked adhere (order keep consistency across functions): dataset (additional datasets denoted dataset_*) by_vars order new_var (related new_var_* arguments) filter (additional filters denoted filter_*) Make sure always mention start_date end_date (related). Names variables inside dataset passed symbols rather strings, .e. AVAL rather \"AVAL\". argument accepts one variables expressions input variables expressions wrapped inside exprs(). example: new_var = TEMPBL by_vars = exprs(PARAMCD, AVISIT) filter = PARAMCD == \"TEMP\" order = exprs(AVISIT, desc(AESEV)) new_vars = exprs(LDOSE = EXDOSE, LDOSEDT = convert_dtc_to_dt(EXSTDTC)) function argument needs tested assert_ type function. expression needs tested following (many utility functions admiral available contributor): whether expression (list expressions, depending function) whether valid expression (.e. whether evaluates without error)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"common-function-arguments-naming-convention","dir":"Articles","previous_headings":"Functions in R","what":"Common Function Arguments Naming Convention","title":"Programming Strategy","text":"first argument derive_ functions input dataset named dataset. one input dataset required, input dataset start dataset_, e.g., dataset_ex. Arguments specifying items add start new_. variable added, second part argument name var, parameter added, param. example: new_var, new_var_unit, new_param. Arguments expect boolean boolean vector must start verb, e.g., is_imputed impute_date. Arguments expect one value variable name must singular version word(s), e.g., missing_value new_var. Arguments expect several values variable names (list, expressions, etc.) must plural version word(s), e.g., missing_values new_vars.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"source-code-formatting","dir":"Articles","previous_headings":"Functions in R","what":"Source Code Formatting","title":"Programming Strategy","text":"source code formatted according tidyverse style guide. lintr styler packages used check enforce .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"comments","dir":"Articles","previous_headings":"Functions in R","what":"Comments","title":"Programming Strategy","text":"Comments added help readers author understand code. two main cases: intention chunk code clear, comment added. comment rephrase code provide additional information. Bad Good long functions (>100 lines) comments can added structure code simplify navigation. case comment end ---- add entry document outline RStudio. example: formatting comments must follow tidyverse style guide. .e., comment start single # space. decoration (except outline entries) must added. Bad Good","code":"# If AVAL equals zero, set it to 0.0001. Otherwise, do not change it mutate(dataset, AVAL = if_else(AVAL == 0, 0.0001, AVAL)) # AVAL is to be displayed on a logarithmic scale. # Thus replace zeros by a small value to avoid gaps. mutate(dataset, AVAL = if_else(AVAL == 0, 0.0001, AVAL)) # Check arguments ---- # This is a comment # ########################### # This is another comment # ########################### #+++++++++++++++++++++++++++++++ # This is a section comment ---- #+++++++++++++++++++++++++++++++ # This is a comment # This is another comment # This is a section comment ----"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"input-checking","dir":"Articles","previous_headings":"Functions in R","what":"Input Checking","title":"Programming Strategy","text":"line fail-fast design principle, function inputs checked validity , ’s invalid input, function stop immediately error. exception case variable added function already exists input dataset: warning displayed function continue executing. Inputs checked using custom assertion functions defined R/assertions.R. custom assertion functions either return error case invalid input return nothing. common types input arguments like single variable, list variables, dataset, … functions checking available (see assertions). Arguments expect keywords handle case-insensitive manner, e.g., date_imputation = \"FIRST\" date_imputation = \"first\" accepted. assert_character_scalar() function helps handling arguments case-insensitive manner. argument checked outer function argument name inner function. rule applicable functions part admiral.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-header-documentation","dir":"Articles","previous_headings":"Functions in R","what":"Function Header (Documentation)","title":"Programming Strategy","text":"Every function exported package must accompanying header formatted according roxygen2 convention. addition standard roxygen2 tags, @family @keywords tags also used. family/keywords used categorize function, used website internal package help pages. Please see section Categorization functions. example given : following fields mandatory: @param: One entry per function argument. following attributes described: expected data type (e.g. data.frame, logical, numeric etc.), permitted values (applicable), optionality (.e. required argument). expected input dataset required variables clearly stated. Describing default value becomes difficult maintain subject manual error already declared function arguments. description permitted values written separate line italicizing phrase “Permitted Values”, example : @details: natural-language description derivation used inside function. @keyword: One applicable tag function - identical family. @family: One applicable tag function - identical keyword. @return: description return value function. newly added variable(-s) mentioned . @examples: fully self-contained example use function. Self-contained means , code executed new R session, run without errors. means packages need loaded library() datasets needed either created directly inside example code loaded using data(). dataset created example, done using function tribble() (specify library(dplyr) calling function). functions called example, please specify library(pkg_name) refer respective function fun() opposed preferred pkg_name::fun() notation specified Unit Test Guidance. Make sure align columns ensures quick code readability. Copying descriptions avoided makes documentation hard maintain. example argument description used one function, argument described one function functions use @inheritParams . Please note @inheritParams func_first used header func_second() function, argument descriptions func_first() included documentation func_second() argument offered func_second() @param tag argument included header func_second(). order @param tags function definition. @inheritParams tags @param. affect order argument description rendered documentation makes easier maintain headers. Variable names, expressions, functions, code must enclosed backticks. render code. functions derive specific CDISC variable, title must state label variable without variable name. variable stated description.","code":"#' Derive Relative Day Variables #' #' Adds relative day variables (`--DY`) to the dataset, e.g., `ASTDY` and #' `AENDY`. #' #' @param dataset Input dataset #' #' The columns specified by the `reference_date` and the `source_vars` #' argument are expected. #' #' @param reference_date The start date column, e.g., date of first treatment #' #' A date or date-time object column is expected. #' #' Refer to `derive_var_dt()` to impute and derive a date from a date #' character vector to a date object. #' #' @param source_vars A list of datetime or date variables created using #' `exprs()` from which dates are to be extracted. This can either be a list of #' date(time) variables or named `--DY` variables and corresponding --DT(M) #' variables e.g. `exprs(TRTSDTM, ASTDTM, AENDT)` or `exprs(TRTSDT, ASTDTM, #' AENDT, DEATHDY = DTHDT)`. If the source variable does not end in --DT(M), a #' name for the resulting `--DY` variable must be provided. #' #' @details The relative day is derived as number of days from the reference #' date to the end date. If it is nonnegative, one is added. I.e., the #' relative day of the reference date is 1. Unless a name is explicitly #' specified, the name of the resulting relative day variable is generated #' from the source variable name by replacing DT (or DTM as appropriate) with #' DY. #' #' @return The input dataset with `--DY` corresponding to the `--DTM` or `--DT` #' source variable(s) added #' #' @keywords der_date_time #' @family der_date_time #' #' @export #' #' @examples #' library(lubridate) #' library(dplyr, warn.conflicts = FALSE) #' #' datain <- tribble( #' ~TRTSDTM, ~ASTDTM, ~AENDT, #' \"2014-01-17T23:59:59\", \"2014-01-18T13:09:O9\", \"2014-01-20\" #' ) %>% #' mutate( #' TRTSDTM = as_datetime(TRTSDTM), #' ASTDTM = as_datetime(ASTDTM), #' AENDT = ymd(AENDT) #' ) #' #' derive_vars_dy( #' datain, #' reference_date = TRTSDTM, #' source_vars = exprs(TRTSDTM, ASTDTM, AENDT) #' ) #' *Permitted Values*: example description of permitted values here"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"categorization-of-functions","dir":"Articles","previous_headings":"Functions in R","what":"Categorization of Functions","title":"Programming Strategy","text":"functions categorized keywords families within roxygen header. Categorization important admiral user-facing functions base totals 125 growing! However, ease burden developers, decided keywords families identical roxygen header, specified via @keywords @family fields. reiterate, function must use keyword family. Also, please note keywords families case-sensitive.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"keywords","dir":"Articles","previous_headings":"Functions in R > Categorization of Functions","what":"@keywords","title":"Programming Strategy","text":"keywords allows reference page easily organized using certain pgkdown functions. example, using function has_keyword(der_bds_gen) _pkgdown.yml file building website collect BDS General Derivation functions display alphabetical order Reference Page section called BDS-Specific.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"family","dir":"Articles","previous_headings":"Functions in R > Categorization of Functions","what":"@family","title":"Programming Strategy","text":"families allow similar functions displayed See Also section function’s documentation. example, user looking derive_vars_dy() function documentation might interested Date/Time functions. Using @family tag der_date_time display Date/Time functions available admiral user See Also section derive_vars_dy() function documentation. Please take look function documentation derive_vars_dy() see family tag action. list available keyword/family tags used admiral functions. think additional keyword/family tag added, please add issue GitHub discussion. NOTE: strongly encouraged @keyword @family identical. eases burden development maintenance admiral functions. need use multiple keywords families, please reach core development team discussion.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"missing-values","dir":"Articles","previous_headings":"","what":"Missing values","title":"Programming Strategy","text":"Missing values (NAs) need explicitly shown. Regarding character vectors converted SAS files: SAS treats missing character values blank. imported R empty strings (\"\") although nature missing values (NA). empty strings originate like need converted proper R missing values NA.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"file-structuring","dir":"Articles","previous_headings":"","what":"File Structuring","title":"Programming Strategy","text":"Organizing functions files art science. Thus, hard rules just recommendations. First foremost, two extremes avoided: putting function file putting functions single file. Apart following recommendations taken consideration deciding upon file structuring: function long (together documentation), store separate file functions documented together, put one file functions sort commonality relevance one another (like dplyr::bind_rows() dplyr::bind_cols()), put one file Store functions together helpers methods 1000 lines single file, unless necessary (exceptions , example, classes methods) responsibility author new function reviewer ensure recommendations put practice.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"r-package-dependencies","dir":"Articles","previous_headings":"","what":"R Package Dependencies","title":"Programming Strategy","text":"Package dependencies documented DESCRIPTION file. package used examples /unit tests listed Suggests, otherwise Imports. Functions packages explicitly imported using @importFrom tag R/admiral-package.R file. import if_else() mutate() function dplyr following line included file: #' @importFrom dplyr if_else mutate. using @importFrom tag, easier track dependencies one place improves code readability. functions become critically important using admiral included export. applies functions frequently called within {admiral }function calls like rlang::exprs(), dplyr::desc() pipe operator dplyr::%>%. export functions, following R code included R/reexports.R file using format:","code":"#' @export pkg_name::fun"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"metadata","dir":"Articles","previous_headings":"","what":"Metadata","title":"Programming Strategy","text":"Functions perform derivation logic add kind metadata, e.g. labels.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"unit-testing","dir":"Articles","previous_headings":"","what":"Unit Testing","title":"Programming Strategy","text":"function requires set unit tests verify produces expected result. See Writing Unit Tests {admiral} details.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"deprecation","dir":"Articles","previous_headings":"","what":"Deprecation","title":"Programming Strategy","text":"deprecation strategy provides stability users allowing admiral developers ability remove update code base coming days. Phase 1: release identified function argument deprecated, message issued using function argument using deprecate_inform(). message appear user least one year. Templates, vignettes internal calls updated use new recommended function/argument. Phase 2: least one year closet next release, warning issued using function argument using deprecate_warn(). warning message appear least one year. Phase 3: least one year closest next release, error thrown using function argument using deprecate_stop() follow similar process Phase 1 Phase 2. Phase 4: Finally three years time identified deprecation, function argument completely removed admiral. NB: Major/Minor release make sense deprecation updates. However, release cycle becomes multiple years, patch releases considered help keep admiral neat tidy! NB: Take care NEWS.md entries around deprecation person continuing process might !","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"documentation","dir":"Articles","previous_headings":"Deprecation","what":"Documentation","title":"Programming Strategy","text":"function argument removed, documentation must updated indicate function argument now deprecated new function/argument used instead. documentation updated Phase 1: description level function lifecycle badge added, @keywords @family roxygen tags replaced deprecated Example documentation argument level @param level argument. documentation updated Phase 3: @examples section removed.","code":"#' Title of the function #' #' @description #' `r lifecycle::badge(\"deprecated\")` #' #' This function is *deprecated*, please use `new_fun()` instead. #' . #' @family deprecated #' @keywords deprecated @param old_param `r lifecycle::badge(\"deprecated\")` Please use `new_param` instead."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"handling-of-messages-warnings-and-errors","dir":"Articles","previous_headings":"Deprecation","what":"Handling of Messages, Warnings and Errors","title":"Programming Strategy","text":"function argument deprecated, function must updated issue message, warning error using deprecate_inform(), deprecate_warn() deprecate_stop(), respectively, described . test case added test file function checks whether message/warning/error issued appropriate using deprecated function argument.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function","dir":"Articles","previous_headings":"Deprecation > Handling of Messages, Warnings and Errors","what":"Function","title":"Programming Strategy","text":"Phase 1: start phase call deprecate_inform() appear : NB: Please adjust phrase {beginning 20XX} relevant timeline. code deprecated function replaced call new function used instead. Phase 2: start phase call deprecate_warn() appear : NB: Please adjust phrase {beginning 20XX} relevant timeline. Phase 3: start phase call deprecate_stop() appear : Phase 4: Function removed package.","code":"fun_xxx <- function(dataset, some_param, other_param) { deprecate_inform( when = \"x.y.z\", what = \"fun_xxx()\", with = \"new_fun_xxx()\", details = c( x = \"This message will turn into a warning {at the beginning of 20XX}.\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) ) new_fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param ) } fun_xxx <- function(dataset, some_param, other_param) { deprecate_warn( when = \"x.y.z\", what = \"fun_xxx()\", with = \"new_fun_xxx()\", details = c( x = \"This message will turn into a error {at the beginning of 20XX}.\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) ) new_fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param ) } fun_xxx <- function(dataset, some_param, other_param) { deprecate_stop( when = \"x.y.z\", what = \"fun_xxx()\", with = \"new_fun_xxx()\" ) new_fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param ) }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"argument","dir":"Articles","previous_headings":"Deprecation > Handling of Messages, Warnings and Errors","what":"Argument","title":"Programming Strategy","text":"Phase 1: argument renamed replaced, message must issued new argument takes value old argument next phase. Note: arguments passed exprs() argument (e.g. new_var = VAR1 filter = AVAL > 10) need quoted. Phase 2: argument renamed replaced, warning must issued new argument takes value old argument next phase Note: arguments passed exprs() argument (e.g. new_var = VAR1 filter = AVAL > 10) need quoted. Phase 3: argument removed replaced, error must generated: Phase 4: mentions argument completely removed admiral.","code":"if (!missing(old_param)) { deprecate_inform(\"x.y.z\", \"fun_xxx(old_param = )\", \"fun_xxx(new_param = )\") # old_param is given using exprs() new_param <- old_param # old_param is NOT given using exprs() new_param <- enexpr(old_param) } if (!missing(old_param)) { deprecate_warn(\"x.y.z\", \"fun_xxx(old_param = )\", \"fun_xxx(new_param = )\") # old_param is given using exprs() new_param <- old_param # old_param is NOT given using exprs() new_param <- enexpr(old_param) } if (!missing(old_param)) { deprecate_stop(\"x.y.z\", \"fun_xxx(old_param = )\", \"fun_xxx(new_param = )\") }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"unit-testing-1","dir":"Articles","previous_headings":"Deprecation","what":"Unit Testing","title":"Programming Strategy","text":"Unit tests deprecated functions arguments must added test file 1 function ensure message, warning, error issued. unit-test follow corresponding format, per unit test guidance.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"for-deprecated-functions-that-issue-a-message-phase-1","dir":"Articles","previous_headings":"Deprecation > Unit Testing","what":"For Deprecated Functions that Issue a Message (Phase 1)","title":"Programming Strategy","text":"Please put tests deprecation top test file make finding specific test easier next phase deprecation. Tests call multiple functions deprecation messages can wrapped using parentheses curly brackets, e.g. expect_snapshot({}). can use withr::local_options(list(lifecycle_verbosity = \"quiet\")) suppress deprecation messages already created tests.","code":"## Test 1: deprecation message if function is called ---- test_that(\"derive_var_example() Test #: deprecation message if function is called\", { expect_snapshot({ ae <- date_source(...) ... derive_var_example(...) }) }) ## Test 2: Test of function argument 1 ---- test_that(\"derive_var_example() Test 2: Test of function argument 1\", { withr::local_options(list(lifecycle_verbosity = \"quiet\")) ... })"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"for-deprecated-functions-that-issue-a-warning-phase-2","dir":"Articles","previous_headings":"Deprecation > Unit Testing","what":"For Deprecated Functions that Issue a Warning (Phase 2)","title":"Programming Strategy","text":"snapshot deprecation message test must updated instead message warning issued now.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"for-deprecated-functions-that-issue-an-error-phase-3","dir":"Articles","previous_headings":"Deprecation > Unit Testing","what":"For Deprecated Functions that Issue an Error (Phase 3)","title":"Programming Strategy","text":"unit test like following must added. writing unit test, check error right class, .e., \"lifecycle_error_deprecated\". unit tests deprecated function must removed.","code":"## Test #: error if function is called ---- test_that(\"derive_var_example() Test #: deprecation error if function is called\", { expect_error( derive_var_example(), class = \"lifecycle_error_deprecated\" ) })"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"best-practices-and-hints","dir":"Articles","previous_headings":"","what":"Best Practices and Hints","title":"Programming Strategy","text":"Please take following list recommendation try adhere rules possible. Arguments function calls named except first parameter (e.g. assert_data_frame(dataset, required_vars = exprs(var1, var2), optional = TRUE)). dplyr::if_else() used two conditions. Try always set missing argument whenever appropriate.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"how-quoting-is-used","dir":"Articles","previous_headings":"Best Practices and Hints","what":"How Quoting is used","title":"Programming Strategy","text":"admiral arguments require selecting one particular option like mode, e.g. mode = \"last\". Use quotation marks capture . expected assertion function corresponding arguments assert_character_scalar()/assert_character_vector(). Many admiral arguments require capturing expression, typically encased exprs() statement, evaluated later inside function body, see arguments like new_vars, e.g. new_vars = exprs(TRTSDTM = EXSTDTM). Oftentimes, assertion function corresponding assert_expr()/assert_expr_list(). arguments unquoted using !!!. admiral arguments like new_var filter expect single variable expression quoted call. function body, quoted using enexpr(). Usually combined assertion, e.g., new_var <- assert_symbol(enexpr(new_var)). arguments unquoted using !!. Keep mind !! one--one replacement !!! one--many replacement. Please see chapter Advanced R textbook details.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"standardizing-text-used-to-label-and-describe-arguments","dir":"Articles","previous_headings":"Best Practices and Hints","what":"Standardizing Text Used to Label and Describe Arguments","title":"Programming Strategy","text":"following PR, find example function argument dataset able standardized Label Description said function argument aligned across codebase. Please see changes file derive_adeg_params.R details. benefits programmatic way write documentation changes need made, making modification corresponding function, case, roxygen_param_dataset(), scales across codebase, can tested, less prone user-error typos grammar mistakes. functions implemented roxygen2.R naming convention argument follows roxygen_param_xxx(), “xxx” replaced argument name.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"r-and-package-versions-for-development","dir":"Articles","previous_headings":"","what":"R and Package Versions for Development","title":"Programming Strategy","text":"choice R Version Package versions set stone. However, common development environment important establish working across multiple companies multiple developers. currently recommend developers work latest R version latest available packages. However, deviate time developers come go admiral. actually see positive, .e. deviations developers, introduces bit random stress testing code base. GitHub allows us Actions/Workflows test admiral several versions R well several versions dependent R packages needed admiral. Currently test admiral two latest R Versions closest snapshots packages R versions. can view workflow others admiralci GitHub Repository.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"common-r-cmd-check-issues","dir":"Articles","previous_headings":"","what":"Common R CMD Check Issues","title":"R CMD Issues","text":"R CMD check command line tool checks R packages standard set criteria. pull request pass check must issue notes, warnings errors. list common issues resolve .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"check-fails-only-on-one-version","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Check Fails Only on One Version","title":"R CMD Issues","text":"R CMD check workflow fails one two R versions can helpful reproduce testing environment locally. reproduce particular R version environment open admiral project corresponding R version, comment line source(\"renv/activate.R\") .Rprofile file, restart R session run following commands R console. ensure exact package versions use workflow installed hidden folder .library. way existing R packages overwritten.","code":"Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS = \"true\") if (!dir.exists(\".library\")) { dir.create(\".library\") } base_recommended_pkgs <- row.names(installed.packages(priority = \"high\")) for (pkg in base_recommended_pkgs) { path <- file.path(.Library, pkg) cmd <- sprintf(\"cp -r %s .library\", path) system(cmd) } assign(\".lib.loc\", \".library\", envir = environment(.libPaths)) r_version <- getRversion() if (grepl(\"^4.1\", r_version)) { options(repos = \"https://packagemanager.posit.co/cran/2021-05-03/\") } else if (grepl(\"^4.2\", r_version)) { options(repos = \"https://packagemanager.posit.co/cran/2022-01-03/\") } else if (grepl(\"^4.3\", r_version)) { options(repos = \"https://packagemanager.posit.co/cran/2023-04-20/\") } else { options(repos = \"https://cran.rstudio.com\") } if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_deps(dependencies = TRUE) remotes::install_github(\"pharmaverse/pharmaversesdtm\", ref = \"devel\") remotes::install_github(\"pharmaverse/admiraldev\", ref = \"devel\") rcmdcheck::rcmdcheck()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"package-dependencies","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Package Dependencies","title":"R CMD Issues","text":"Add pkg Imports Suggests field DESCRIPTION file. general, dependencies listed Imports field. However, package used inside vignettes unit tests listed Suggests admiral functions work without “soft” dependencies installed.","code":"> checking package dependencies ... ERROR Namespace dependency not required: 'pkg'"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"global-variables","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Global Variables","title":"R CMD Issues","text":"Add some_var list “global” variables R/globals.R.","code":"❯ checking R code for possible problems ... NOTE function_xyz: no visible binding for global variable 'some_var'"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"undocumented-function-parameter","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Undocumented Function Parameter","title":"R CMD Issues","text":"Add @param some_param section header function_xyz() run devtools::document() afterwards.","code":"❯ checking Rd \\usage sections ... WARNING Undocumented arguments in documentation object 'function_xyz' 'some_param'"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"outdated-documentation","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Outdated Documentation","title":"R CMD Issues","text":"name parameter changed function code yet header. Change @param old_param_name @param new_param_name run devtools::document(). reading recommend R-pkg manual r-cmd chapter","code":"❯ checking for code/documentation mismatches ... WARNING Codoc mismatches from documentation object 'function_xyz': ... Argument names in code not in docs: new_param_name Argument names in docs not in code: old_param_name Mismatches in argument names: Position: 6 Code: new_param_name Docs: old_param_name"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Release Strategy","text":"article explains package releases admiral across package extensions. includes details around planned/scheduled releases, well hotfixes.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"release-schedule","dir":"Articles","previous_headings":"","what":"Release Schedule","title":"Release Strategy","text":"release schedule maintained homepage.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"planning-releases","dir":"Articles","previous_headings":"","what":"Planning Releases","title":"Release Strategy","text":"past, whenever started looking towards future release, create new release issue label GitHub form release Q4-2022 prioritize issues. However, backlog minimal every issue considered Priority Issue. issue Priority, sent back Discussion Tab formed Priority issue. share advance users high level summary expected package updates via community meetings, especially anticipated breaking changes.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"package-release-process","dir":"Articles","previous_headings":"","what":"Package Release Process","title":"Release Strategy","text":"following important steps planned release hot fix release described. Depending package may helpful use usethis::use_release_issue() package-specific release_bullets() function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"planned-release","dir":"Articles","previous_headings":"Package Release Process","what":"Planned Release","title":"Release Strategy","text":"package release done following steps: Create release version: Create new feature branch main. Call usethis::use_version() update Versions: field DESCRIPTION file update NEWS.md (replace “(development version)” version released) Create PR main merge . title PR must contain “[skip vbump]”. Otherwise, vbump workflow sets version development version CRAN reject submission. Bundle main (devtools::build(manual = TRUE)) send CRAN. See chapter R Packages details. CRAN asks modifications, repeat steps 1-2 necessary. package accepted available CRAN, use release button GitHub “release” package onto GitHub, select main branch target, use tag form vX.Y.Z, e.g., v1.1.2 (see past admiral releases reference Releasing Github section details). releases onto Github archives version code within main branch, attaches News/Changelog file, bundles code tar.gz file makes validation report via GitHub action validation insightsengineering/validatoR. also builds website released version stores new vx.y.z folder gh-pages branch. Merge main patch prepared case needed hotfix. Create next development version: Create new feature branch main. Call usethis::use_dev_version() update NEWS.md (adds new section # admiral (development version)) update version DESCRIPTION file development version. Create PR main merge .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"hot-fix-release","dir":"Articles","previous_headings":"Package Release Process","what":"Hot Fix Release","title":"Release Strategy","text":"Rarely, may need release hot fix immediately address bug. majority cases, -cycle release can made directly main branch, bug fixes new features released earlier planned, thus avoiding patch branch release. hot fix release done following steps: Identify bugs need fixed hot fix release label “hotfix” label. Branches addressing bugs Pull Requests merged single patch branch main branch, patch branch created recent release package. , run following git commands: git checkout -b patch vX.Y.Z git push -u origin patch need use development versions. .e., first pull request set version DESCRIPTION version released corresponding heading added NEWS.md. naming branch follow naming conventions guide. PRs hot fix merged (patch), bundle patch (devtools::build(manual = TRUE)) send CRAN. See chapter R Packages details. CRAN asks modifications, repeat steps 1-4 necessary. package accepted available CRAN, , use release button GitHub “release” package onto GitHub, select patch branch target, use tag form vX.Y.Z, e.g., v1.1.2 (see past admiral releases reference Releasing Github section details). releases onto Github archives version code within patch branch, attaches News/Changelog file, bundles code tar.gz file makes validation report via GitHub action validation insightsengineering/validatoR. also builds website released version stores new vx.y.z folder gh-pages branch. hot fixes merged main branch additional Pull Request. Merging PR update version DESCRIPTION file development version. Create next development version: Create new feature branch main. Update NEWS.md (add new section # admiral (development version)) Create PR main merge .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"releasing-to-github","dir":"Articles","previous_headings":"","what":"Releasing to Github","title":"Release Strategy","text":"Releases section main repo, select Draft New Release. Proceed creating appropriate release tag header, denoted vX.X.X admiral X.X.X respectively, release: Copy contents NEWS.md section release, paste release notes section: upload box says, “Attach binaries dropping selecting ” upload appropriate admiral_X.X.X.tar.gz file available download CRAN website. Click Publish Release ’re done! NB: Occasionally, might need delete tag something done error. Deleting tag can done GitHub must done terminal. However, easy!! Just use: git push --delete origin tagname","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"release-tracking","dir":"Articles","previous_headings":"","what":"Release Tracking","title":"Release Strategy","text":"new package release submitted CRAN awaiting go-live, can track status searching within dashboard.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"communications","dir":"Articles","previous_headings":"","what":"Communications","title":"Release Strategy","text":"release, raise awareness via Slack channel LinkedIn.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"unit-tests-become-a-safety-net-for-developers","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Unit Tests Become a Safety Net for Developers","title":"Unit Test Guidance","text":"comprehensive suite unit tests can act safety net developers. frequently running tests, can assure recent modifications code haven’t broken anything. words, unit tests help prevent regressions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"unit-tests-can-contribute-to-higher-code-quality","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Unit Tests Can Contribute to Higher Code Quality","title":"Unit Test Guidance","text":"Since unit tests act safety net, developers become confident changing code. can refactor code without fear breaking things, driving general quality code base .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"unit-tests-can-contribute-to-better-application-architecture","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Unit Tests Can Contribute to Better Application Architecture","title":"Unit Test Guidance","text":"can add unit tests easily code base, ’s usually good sign regarding quality app’s architecture. , drive write testable code can incentive better architecture.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"detects-code-smells-in-your-codebase","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Detects Code Smells in your Codebase","title":"Unit Test Guidance","text":"ease adding unit tests code base good sign, opposite also true. hard time creating unit tests given piece code might sign code smells code—e.g. functions complex.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-fast","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Tests Should Be Fast","title":"Unit Test Guidance","text":"’re slow, developers won’t run often . defeats whole purpose suite unit tests first place, boost developers’ confidence make changes code. tests can’t work safety net ’re run often.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-simple","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Tests Should Be Simple","title":"Unit Test Guidance","text":"several techniques can apply high degree confidence correctness tests. One keep tests low cyclomatic complexity. Cyclomatic complexity code metric indicates number possible execution paths given method can follow. piece code lower complexity easier understand maintain, means developers less likely introduce bugs working . can measure cyclomatic complexity tests (using, instance, linter tool) best keep low.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"test-shouldnt-duplicate-implementation-logic","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Test Shouldn’t Duplicate Implementation Logic","title":"Unit Test Guidance","text":"person wrote test implementation, ’s possible made errors places. Since tests mirror implementation, might still pass, implementation wrong, tests might fool thinking otherwise. Resist urge make tests fancy, keep simple, testing suite better .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-readable","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Tests Should Be Readable","title":"Unit Test Guidance","text":"best practice overlaps little bit one keeping tests simple. tests hard read, developers likely misunderstand introduce bugs. Test cases used form documentation, obviously need readable.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"running-unit-tests-part-of-the-build-process","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Running Unit Tests Part of the Build Process","title":"Unit Test Guidance","text":"Automate whole process running unit tests taking action fail. build process execute unit tests mark build broken tests fail.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"plan-your-unit-tests","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Plan your Unit Tests","title":"Unit Test Guidance","text":"Start considering derivation rule testing possible arguments/flexibilities function code. plan scenarios test. can either involve generating different input test cases feeding different calls function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"test-coverage","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Test coverage","title":"Unit Test Guidance","text":"Unit tests cover functionality function. another function g() called within function f(), unit tests f() test functionality g(). tested unit tests g(), .e. unit tests added lowest level.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-robust-to-cover-realistic-data-scenarios","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Tests Should be Robust to Cover Realistic Data Scenarios","title":"Unit Test Guidance","text":"generating input test cases, can helpful consider regular cases (expected common data scenarios), boundary cases (data points close equal), special cases (uncommon valid data scenarios, e.g. missing special characters). Although never cover every single eventuality possible input data (reliability testing method ever gives 100% certainty), need give confidence code robust enough work across data scenarios.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"testing-should-cover-possible-arguments","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Testing Should Cover Possible Arguments","title":"Unit Test Guidance","text":"different calls function, consider user might apply function test variety possible calls, whilst still remembering tips tests fast simple. needed cases complexity level flexibility function justifies , e.g. see test script: https://github.com/pharmaverse/admiral/blob/main/tests/testthat/test-derive_var_extreme_flag.R.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"exported-functions","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Exported Functions","title":"Unit Test Guidance","text":"Don’t forget add unit test exported function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"snapshot-testing","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Snapshot Testing","title":"Unit Test Guidance","text":"Standard unit tests always convenient record expected behavior code. challenges include: Output large, making painful define reference output, bloating size test file making hard navigate. Text output includes many characters like quotes newlines require special handling string. Binary formats like plots images, difficult describe code: .e. plot looks right, error message useful human, print method uses color effectively. situations, testthat provides alternative mechanism: snapshot tests. Snapshot tests record results separate human readable file records results, including output, messages, warnings, errors. Review {testthat} snapshot vignette details.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"set-up-the-test-script","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Set up the Test Script","title":"Unit Test Guidance","text":"Within tests/testthat folder project, add script naming convention test-.R., unit test script can created console also, follows: testing framework used testthat following format : example, testing function called my_new_func contained script all_funcs.R console use: Open newly created file test-all_funcs.R use following format: Note: comparing datasets admiral use function expect_dfs_equal(). input expected output unit tests must follow following rules: Input output simple possible. Values hard-coded whenever possible. values need derived, unit tested functions can used. contrast Programming Strategy documentation function examples, test files include library(pkg_name) calls. dataset needs created testing purposes, done using function tribble() tibble package following command dplyr::tribble(). Furthermore, functions need called, also done using pkg_name::fun()notation. Make sure align columns well. ensures quick code readability. Ensure give meaningful explanation test testthat call, compiled package validation report. name function test ID included title also help traceability. comments ending ---- create entries TOC RStudio.","code":"usethis::use_test(\"\") ## Test 1: ---- test_that(\" Test 1: \", { input <- dplyr::tribble( ~inputvar1, ~inputvar2, ... ... ) expected_output <- mutate(input, outputvar = c()) expect_dfs_equal((input), expected_output) }) usethis::use_test(\"all_funcs\") # my_new_func ---- ## Test 1: ---- test_that(\"my_new_func Test 1: \", { input <- dplyr::tribble( ~inputvar1, ~inputvar2, ... ... ) expected_output <- mutate(input, outputvar = c()) expect_dfs_equal((input), expected_output) })"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"addin-pharmaverse4devsformat_test_that_file","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Addin pharmaverse4devs::format_test_that_file()","title":"Unit Test Guidance","text":"ease burden developers writing adding tests developed Addin formatting test_that test files according admiral programming standards. Addin add update comments well number re-numbers tests. access Addin, sure install {pharmaverse4devs} Github. install latest development version package directly GitHub use following code: use Addin button select “Format test_that test file” seen image. sure test-file open selected calling Addin. Addin perform following: Updates adds number tests comments test_that() call Updates comments based description provided test_that() call Updates function name test_that() call. function name extracted last # ---- comment test_that() call. test file tests one function, comments added first test function. test files tests single function , comments can omitted. case addin determines function name file name stripping “test-” prefix “.R” suffix. writing new unit tests, just provide description test_that() call necessary function name # ---- comment: Call addin get: tested unit test program, can run unit tests console, follows. running just tests current file call","code":"if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_github(\"pharmaverse/pharmaverse4devs\") # derive_vars_merged ---- test_that( \"works if it merges all variables\", { actual <- derive_vars_merged(advs, dataset_add = adsl, by_vars = exprs(STUDYID, USUBJID) ) # convert_dtm_to_dtc ---- test_that(\"works if dtm is in correct format\", { expect_equal( convert_dtm_to_dtc(as.POSIXct(\"2022-04-05 15:34:07 UTC\")), \"2022-04-05T15:34:07\" ) }) test_that(\"Error is thrown if dtm is not in correct format\", { expect_error( convert_dtm_to_dtc(\"2022-04-05T15:26:14\"), \"lubridate::is.instant(dtm) is not TRUE\", fixed = TRUE ) }) # derive_vars_merged ---- ## Test 1: derive_vars_merged ---- test_that( \"derive_vars_merged Test 1: it merges all variables\", { actual <- derive_vars_merged(advs, dataset_add = adsl, by_vars = exprs(STUDYID, USUBJID) ) # convert_dtm_to_dtc ---- ## Test 2: works if dtm is in correct format ---- test_that(\"convert_dtm_to_dtc Test 2: works if dtm is in correct format\", { expect_equal( convert_dtm_to_dtc(as.POSIXct(\"2022-04-05 15:34:07 UTC\")), \"2022-04-05T15:34:07\" ) }) ## Test 3: Error is thrown if dtm is not in correct format ---- test_that(\"convert_dtm_to_dtc Test 3: Error is thrown if dtm is not in correct format\", { expect_error( convert_dtm_to_dtc(\"2022-04-05T15:26:14\"), \"lubridate::is.instant(dtm) is not TRUE\", fixed = TRUE ) }) devtools::test() devtools::test_file()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"automation-of-unit-tests","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Automation of Unit Tests","title":"Unit Test Guidance","text":"user actions pull request {admiral} GitHub repo, unit tests automatically run pull request denied unit tests fail.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Writing Vignettes","text":"guidance ensures consistency across vignettes admiral package terms content, structure code execution. general rule, vignette workflow defined r-pkgs.org followed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"metadata","dir":"Articles","previous_headings":"","what":"Metadata","title":"Writing Vignettes","text":"vignette admiral start following metadata. vignette meaningful.","code":"--- title: \"\" output: rmarkdown::html_vignette: vignette: > %\\VignetteIndexEntry{} %\\VignetteEngine{knitr::rmarkdown} ---"},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"default-options","dir":"Articles","previous_headings":"Markdown","what":"Default Options","title":"Writing Vignettes","text":"chunks used within vignette, following options set metadata ensure chunks rendered consistently across vignettes.","code":"```{r setup, include=FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = \"#>\" ) ```"},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"table-of-contents","dir":"Articles","previous_headings":"Markdown > Format Sections","what":"Table of Contents","title":"Writing Vignettes","text":"Headings must title case start Heading 1: first section gives brief introduction vignette. last sub-section introduction describe packages required run admiral functions. admiral package described first. warning=FALSE message=FALSE options prevent usual messages: Attaching package: ‘xxxx’following objects masked ‘package:yyyyy’ fun1, fun2","code":"# Heading 1 This is the description of my first section. ## Heading 1.1 This is the description of my first sub-section within my first section. ## Heading 1.2 This is the description of my second sub-section within my first section. # Introduction This is the introduction of my vignette. ## Required Packages ```{r, warning=FALSE, message=FALSE} library(admiral) # ```"},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"general-conventions","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"General Conventions","title":"Writing Vignettes","text":"new vignette must added _pkgdown.yml file relevant section. variable name, dataset name, function, argument name must quoted backticks: e.g. Functions must also end (). Variables datasets name expected uppercase. codes must described, executed output result displayed code executed. Use: output created must clearly show function derived. least show variables/records used input function derived variables/records. dataset must displayed, formatted using dataset_vignette() function displayed consistently across vignettes.E.g. Description execution code used derive variable/record Output dataset formatted using dataset_vignette()… Note: call get formatted dataset : Displaying many big datasets vignette, may require long time load page may cause messages browser page responsive. case number displayed observations restricted either restricting source datasets beginning vignette call dataset_vignette() calls affected.","code":"The `date` parameter of the `derive_my_var()` function expects a date variable, e.g., `ADT`. ```{r} # ``` vs1 <- vs %>% derive_vars_dt( new_vars_prefix = \"A\", dtc = VSDTC, date_imputation = \"first\" ) ``` r dataset_vignette( vs1, display_vars = exprs(USUBJID, VSTESTCD, VISIT, VSDTC, ADT), filter = VSTESTCD == \"WEIGHT\" ) ```"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"using-footnotes","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Using Footnotes","title":"Writing Vignettes","text":"Footnotes can useful add context without adding clutter primary subject matter vignette written. use footnotes, add caret identifier inside brackets e.g. ([^1]). identifiers can numbers words, can’t contain spaces tabs. following markdown text render follows: example 1","code":"Here is an example [^1] [^1]: Cool note about the example."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"conventions-for-adam-workflow","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Conventions for ADaM Workflow","title":"Writing Vignettes","text":"vignettes describing ADaM workflow, second section summarize programming workflow. first sub-section within workflow always describe data read demonstrate use admiral functions, sub-section within programming workflow tagged (e.g. [Step1] (#step)), user can go relevant section programming workflow (addition Table contents). Don’t use tag number use meaningful name (e.g. use (#link1), use (#this_action)) last section link template script. ADSL variables ADSL variables required derivation merged SDTM dataset first derivation. ADSL variables added -variables derivations add observations. ensures ADSL variables populated new observations. adsl_vars variable created beginning script added by_vars parameter derivations add observations. ADSL variables final dataset required derivation merged dataset last derivation.","code":"# Programming Workflow * [Read in Data](#readdata) * [Derive/Impute End and Start Analysis Date/time and Relative Day](#datetime) * ... * [Assign `ASEQ`](#aseq) ## Read in Data {#readdata} ## Derive/Impute End and Start Analysis Date/time and Relative Day {#datetime} ## ... ## Assign `ASEQ` {#aseq} # Another Section # Example Script ADaM | Sample Code ---- | -------------- ADxx | [ad_adxx.R](https://github.com/pharmaverse/admiral/blob/main/inst/templates/ad_adxx.R){target=\"_blank\"}"},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ben Straub. Author, maintainer. Stefan Bundfuss. Author. Jeffrey Dickinson. Author. Ross Farrugia. Author. Fanny Gautier. Author. Edoardo Mancini. Author. Sadchla Mascary. Author. Gordon Miller. Author. Daniel Sjoberg. Author. Stefan Thoma. Author. Kangjie Zhang. Author. Zelos Zhu. Author. F. Hoffmann-La Roche AG. Copyright holder, funder. GlaxoSmithKline LLC. Copyright holder, funder.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Straub B, Bundfuss S, Dickinson J, Farrugia R, Gautier F, Mancini E, Mascary S, Miller G, Sjoberg D, Thoma S, Zhang K, Zhu Z (2025). admiraldev: Utility Functions Development Tools Admiral Package Family. R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/, https://pharmaverse.github.io/admiraldev/.","code":"@Manual{, title = {admiraldev: Utility Functions and Development Tools for the Admiral Package Family}, author = {Ben Straub and Stefan Bundfuss and Jeffrey Dickinson and Ross Farrugia and Fanny Gautier and Edoardo Mancini and Sadchla Mascary and Gordon Miller and Daniel Sjoberg and Stefan Thoma and Kangjie Zhang and Zelos Zhu}, year = {2025}, note = {R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/}, url = {https://pharmaverse.github.io/admiraldev/}, }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"admiraldev-","dir":"","previous_headings":"","what":"Utility Functions and Development Tools for the Admiral Package Family","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Utility Functions Development Tools Admiral Package Family","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"purpose","dir":"","previous_headings":"","what":"Purpose","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Functions, tools documentation developing core admiral extension package functions. functions admiraldev around testing inputs going functions. also additional quality life functions/Addins assist developers admiral admiral extension packages, functions help rendering documentation, Developer Guides developing function using GitHub, GitHub Actions. NOTE: package intended standalone use rather central dependency admiral extension packages","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"package available CRAN can installed running install.packages(\"admiraldev\"). install latest development version package directly GitHub use following code:","code":"if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_github(\"pharmaverse/admiraldev\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"release-schedule","dir":"","previous_headings":"","what":"Release Schedule","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"admiraldev released CRAN time official release admiral. can find release schedule admiral packages .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Along authors contributors, thanks following people work package: Ania Golab, Samia Kabi, Pooja Kumari, Syed Mubasheer, Thomas Neitmann Ondrej Slama.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"Add suffix variables list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"add_suffix_to_vars(order, vars, suffix)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"order List expressions Permitted Values: list variables desc() function calls created exprs(), e.g., exprs(ADT, desc(AVAL)) vars Variables change Permitted Values: list variables created exprs() suffix Suffix Permitted Values: character scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"list expression element suffix (suffix) added every symbol specified vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) add_suffix_to_vars(exprs(ADT, desc(AVAL), AVALC), vars = exprs(AVAL), suffix = \".join\") #> [[1]] #> ADT #> #> [[2]] #> desc(AVAL.join) #> #> [[3]] #> AVALC #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":null,"dir":"Reference","previous_headings":"","what":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Utility functions check data, variables conditions functions used 'admiral' 'admiral' extension packages. Additional utility helper functions assist developers maintaining documentation, testing general upkeep 'admiral' 'admiral' extension packages.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Maintainer: Ben Straub ben.x.straub@gsk.com Authors: Stefan Bundfuss (ORCID) Jeffrey Dickinson Ross Farrugia Fanny Gautier Edoardo Mancini (ORCID) Sadchla Mascary Gordon Miller Daniel Sjoberg (ORCID) Stefan Thoma (ORCID) Kangjie Zhang Zelos Zhu contributors: F. Hoffmann-La Roche AG [copyright holder, funder] GlaxoSmithKline LLC [copyright holder, funder]","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract Argument Name from an Expression — arg_name","title":"Extract Argument Name from an Expression — arg_name","text":"Extract Argument Name Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract Argument Name from an Expression — arg_name","text":"","code":"arg_name(expr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract Argument Name from an Expression — arg_name","text":"expr expression created inside function using substitute()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract Argument Name from an Expression — arg_name","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Atomic Vector? — assert_atomic_vector","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"Checks argument atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"assert_atomic_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_atomic_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"function throws error arg atomic vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"example_fun <- function(x) { assert_atomic_vector(x) } example_fun(1:10) try(example_fun(list(1, 2))) #> Error in example_fun(list(1, 2)) : #> Argument `x` must be an atomic vector, but is a list."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Scalar (String)? — assert_character_scalar","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"Checks argument character scalar (optionally) whether matches one provided values.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"assert_character_scalar( arg, values = NULL, case_sensitive = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"arg function argument checked values character vector valid values arg. Values converted lower case vector case_sensitive = FALSE used. case_sensitive argument handled case-sensitive? set FALSE, argument converted lower case checking permitted values returning argument. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"function throws error arg character vector arg character vector length > 1 value one values specified. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"example_fun <- function(msg_type) { assert_character_scalar(msg_type, values = c(\"warning\", \"error\")) } example_fun(\"warning\") try(example_fun(\"message\")) #> Error in example_fun(\"message\") : #> Argument `msg_type` must be equal to one of \"warning\" or \"error\". try(example_fun(TRUE)) #> Error in example_fun(TRUE) : #> Argument `msg_type` must be a scalar of class , but is #> `TRUE`. # handling arguments case-insensitive example_fun2 <- function(msg_type) { msg_type <- assert_character_scalar( msg_type, values = c(\"warning\", \"error\"), case_sensitive = FALSE ) if (msg_type == \"warning\") { print(\"A warning was requested.\") } } example_fun2(\"Warning\") #> [1] \"A warning was requested.\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Vector? — assert_character_vector","title":"Is an Argument a Character Vector? — assert_character_vector","text":"Checks argument character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"assert_character_vector( arg, values = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Vector? — assert_character_vector","text":"arg function argument checked values character vector valid values arg named set TRUE, error issued elements vector named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Vector? — assert_character_vector","text":"function throws error arg character vector element included list valid values. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"example_fun <- function(chr) { assert_character_vector(chr) } example_fun(letters) try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `chr` must be , but is an integer vector. example_fun2 <- function(chr) { assert_character_vector(chr, named = TRUE) } try(example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\"))) #> Error in example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\")) : #> All elements of `chr` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Data Frame? — assert_data_frame","title":"Is an Argument a Data Frame? — assert_data_frame","text":"Checks argument data frame (optionally) whether contains set required variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"assert_data_frame( arg, required_vars = NULL, check_is_grouped = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_data_frame\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Data Frame? — assert_data_frame","text":"arg function argument checked required_vars list variables created using exprs() check_is_grouped Throw error dataset grouped? Defaults TRUE. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Data Frame? — assert_data_frame","text":"function throws error arg data frame arg data frame misses variable specified required_vars. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"library(dplyr) library(rlang) dm <- tribble( ~STUDYID, ~USUBJID, \"XYZ\", \"1\", \"XYZ\", \"2\" ) example_fun <- function(dataset) { assert_data_frame(dataset, required_vars = exprs(STUDYID, USUBJID)) } example_fun(dm) try(example_fun(select(dm, -STUDYID))) #> Error in example_fun(select(dm, -STUDYID)) : #> Required variable `STUDYID` is missing in `dataset` try(example_fun(\"Not a dataset\")) #> Error in example_fun(\"Not a dataset\") : #> Argument `dataset` must be class , but is a string. try(example_fun(group_by(dm, USUBJID))) #> Error in example_fun(group_by(dm, USUBJID)) : #> Argument `dataset` must not be a grouped dataset, please `ungroup()` it."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"Checks variable dataset date datetime variable","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"assert_date_var( dataset, var, dataset_name = rlang::caller_arg(dataset), var_name = rlang::caller_arg(var), message = NULL, class = \"assert_date_var\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"dataset dataset variable expected var variable check dataset_name name dataset. argument specified, specified name displayed error message. var_name name variable. argument specified, specified name displayed error message. message (string) string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"var_name\" \"dataset_name\", can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"function throws error var date datetime variable dataset returns input invisibly otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"library(lubridate) #> #> Attaching package: ‘lubridate’ #> The following objects are masked from ‘package:base’: #> #> date, intersect, setdiff, union library(dplyr) library(rlang) example_fun <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var(dataset = dataset, var = !!var) } my_data <- tribble( ~USUBJID, ~ADT, \"1\", ymd(\"2020-12-06\"), \"2\", ymd(\"\") ) example_fun( dataset = my_data, var = ADT ) try(example_fun( dataset = my_data, var = USUBJID )) #> Error in example_fun(dataset = my_data, var = USUBJID) : #> Column \"USUBJID\" in dataset `dataset` must be a date or datetime, but is #> a character vector. example_fun2 <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var( dataset = dataset, var = !!var, dataset_name = \"your_data\", var_name = \"your_var\" ) } try(example_fun2( dataset = my_data, var = USUBJID )) #> Error in example_fun2(dataset = my_data, var = USUBJID) : #> Column \"your_var\" in dataset `your_data` must be a date or datetime, but #> is a character vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object a date or datetime vector? — assert_date_vector","title":"Is an object a date or datetime vector? — assert_date_vector","text":"Check object/vector date datetime variable without needing dataset input","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"assert_date_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_date_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object a date or datetime vector? — assert_date_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL function assert_date_vector exits early throw error. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an object a date or datetime vector? — assert_date_vector","text":"function returns error arg missing, date datetime variable otherwise returns invisible output.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"example_fun <- function(arg) { assert_date_vector(arg) } example_fun( as.Date(\"2022-01-30\", tz = \"UTC\") ) try(example_fun(\"1993-07-14\")) #> Error in example_fun(\"1993-07-14\") : #> Argument `arg` must be a date or datetime, but is a string."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is an Expression — assert_expr","title":"Assert Argument is an Expression — assert_expr","text":"Assert Argument Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is an Expression — assert_expr","text":"","code":"assert_expr( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_expr\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is an Expression — assert_expr","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is an Expression — assert_expr","text":"function throws error arg expression, .e. either symbol call, returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Expressions? — assert_expr_list","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"Checks argument list expressions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"assert_expr_list( arg, required_elements = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_expr_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"arg function argument checked required_elements character vector names must present arg named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"function throws error arg list expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"library(rlang) example_fun <- function(vars) { assert_expr_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\")))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\"))) : #> All elements of `vars` must be an expression. #> ℹ `vars[[3]]` = `list(\"a\")` is of type , and `vars[[4]]` = `list(\"a\")` is #> of type "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Filter Condition? — assert_filter_cond","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Argument Filter Condition?","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"assert_filter_cond( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_filter_cond\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"arg Quosure - filtering condition. optional Logical - argument optional? Defaults FALSE. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Performs necessary checks returns arg pass. Otherwise throws informative error.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Check arg suitable filtering condition used functions like subset dplyr::filter.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~STUDYID, ~USUBJID, ~AGE, \"DM\", \"STUDY X\", \"01-701-1015\", 64, \"DM\", \"STUDY X\", \"01-701-1016\", 65, ) # typical usage in a function as an argument check example_fun <- function(dat, x) { x <- assert_filter_cond(enexpr(x), arg_name = \"x\") filter(dat, !!x) } example_fun(dm, AGE == 64) #> # A tibble: 1 × 4 #> DOMAIN STUDYID USUBJID AGE #> #> 1 DM STUDY X 01-701-1015 64 try(assert_filter_cond(mtcars)) #> Error in eval(expr, envir) : #> Argument `mtcars` must be a filter condition, but is a data frame"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Is Argument a Function? — assert_function","title":"Is Argument a Function? — assert_function","text":"Checks argument function expected arguments provided function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is Argument a Function? — assert_function","text":"","code":"assert_function( arg, params = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_function\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is Argument a Function? — assert_function","text":"arg function function checked params character vector character vector expected argument names aforementioned function arg. ellipsis, ..., included function formals function arg, argument, params ignored, accepting values character vector. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is Argument a Function? — assert_function","text":"function throws error argument function function provide arguments specified params argument (assuming ellipsis function formals)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is Argument a Function? — assert_function","text":"","code":"example_fun <- function(fun) { assert_function(fun, params = c(\"x\")) } example_fun(mean) try(example_fun(1)) #> Error in example_fun(1) : #> Argument `fun` must be a function, but is a number. try(example_fun(sum)) #> Error in example_fun(sum) : #> \"x\" is not an argument of the function specified for `fun`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Integer Scalar? — assert_integer_scalar","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"Checks argument integer scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"assert_integer_scalar( arg, subset = \"none\", optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_integer_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"arg function argument checked subset subset integers arg part . one \"none\" (default), \"positive\", \"non-negative\" \"negative\". optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"function throws error arg integer belonging specified subset. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"example_fun <- function(num1, num2) { assert_integer_scalar(num1, subset = \"positive\") assert_integer_scalar(num2, subset = \"negative\") } example_fun(1, -9) try(example_fun(1.5, -9)) #> Error in example_fun(1.5, -9) : #> Argument `num1` must be a positive integer scalar. try(example_fun(2, 0)) #> Error in example_fun(2, 0) : #> Argument `num2` must be a negative integer scalar. try(example_fun(\"2\", 0)) #> Error in example_fun(\"2\", 0) : #> Argument `num1` must be a positive integer scalar."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"Checks elements list named lists/classes fulfill certain condition. , error issued elements list fulfilling condition listed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"assert_list_element( list, element, condition, message_text, arg_name = rlang::caller_arg(list), message = NULL, class = \"assert_list_element\", call = parent.frame(), ... )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"list list checked list named lists classes expected. element name element lists/classes character scalar expected. condition Condition fulfilled condition evaluated element list. element lists/classes can referred name, e.g., censor == 0 check censor field class. message_text Text displayed error message listing values meet condition. text describe condition fulfilled, e.g., \"Error {arg_name}: censor values must zero.\". message argument specified, text displayed message_text ignored. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages. ... Objects required evaluate condition message text condition message text contains objects apart element, passed function. See second example .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"error condition met. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"death <- list( dataset_name = \"adsl\", date = \"DTHDT\", censor = 0 ) lstalv <- list( dataset_name = \"adsl\", date = \"LSTALVDT\", censor = 1 ) events <- list(death, lstalv) try(assert_list_element( list = events, element = \"censor\", condition = censor == 0, message_text = \"For events the censor values must be zero.\" )) #> Error in eval(expr, envir) : #> For events the censor values must be zero. #> ℹ But, `events[[2]]$censor = 1` try(assert_list_element( list = events, element = \"dataset_name\", condition = dataset_name %in% c(\"adrs\", \"adae\"), valid_datasets = c(\"adrs\", \"adae\"), message_text = paste( \"The dataset name must be one of the following: {.val {valid_datasets}}\" ) )) #> Error in eval(expr, envir) : #> The dataset name must be one of the following: \"adrs\" and \"adae\" #> ℹ But, `events[[1]]$dataset_name = adsl`, and `events[[2]]$dataset_name = adsl`"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"Checks argument list objects inheriting S3 class type specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"assert_list_of( arg, cls, named = FALSE, optional = TRUE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_list_of\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"arg function argument checked cls S3 class type check named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"function throws error arg list arg list elements objects inheriting class type class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"example_fun <- function(list) { assert_list_of(list, \"data.frame\") } example_fun(list(mtcars, iris)) try(example_fun(list(letters, 1:10))) #> Error in example_fun(list(letters, 1:10)) : #> Each element of the list in argument `list` must be class/type #> . #> ℹ But, element 1 is a character vector, and element 2 is an integer vector try(example_fun(c(TRUE, FALSE))) #> Error in example_fun(c(TRUE, FALSE)) : #> Argument `list` must be class , but is a logical vector. example_fun2 <- function(list) { assert_list_of(list, \"numeric\", named = TRUE) } try(example_fun2(list(1, 2, 3, d = 4))) #> Error in example_fun2(list(1, 2, 3, d = 4)) : #> All elements of `list` argument must be named. #> ℹ The indices of the unnamed elements are 1, 2, and 3"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"Checks argument logical scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"assert_logical_scalar( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_logical_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown. Otherwise, NULL considered valid value. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"function throws error arg neither TRUE FALSE. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"example_fun <- function(flag) { assert_logical_scalar(flag) } example_fun(FALSE) try(example_fun(NA)) #> Error in example_fun(NA) : #> Argument `flag` must be either TRUE or FALSE, but is `NA`. try(example_fun(c(TRUE, FALSE, FALSE))) #> Error in example_fun(c(TRUE, FALSE, FALSE)) : #> Argument `flag` must be either TRUE or FALSE, but is a logical vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `flag` must be either TRUE or FALSE, but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is a Named List or Vector — assert_named","title":"Assert Argument is a Named List or Vector — assert_named","text":"Assert elements argument named.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"assert_named( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_named\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is a Named List or Vector — assert_named","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is a Named List or Vector — assert_named","text":"function throws error arg named list vector returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"example_fun <- function(varval_list) { assert_named(varval_list) } example_fun(list(var1 = 1, var2 = \"x\")) try(example_fun(list(1, \"x\"))) #> Error in example_fun(list(1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 1 and 2 try(example_fun(list(var = 1, \"x\"))) #> Error in example_fun(list(var = 1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Numeric Vector? — assert_numeric_vector","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"Checks argument numeric vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"assert_numeric_vector( arg, length = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_numeric_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"arg function argument checked length Expected length argument specified set NULL, length accepted. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"function throws error arg numeric vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"example_fun <- function(num) { assert_numeric_vector(num) } example_fun(1:10) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `num` must be a numeric vector, but it is a character vector. example_fun <- function(num) { assert_numeric_vector(num, length = 2) } try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `num` must be a vector of length 2, but has length 10."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":null,"dir":"Reference","previous_headings":"","what":"Is There a One to One Mapping between Variables? — assert_one_to_one","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"Checks one one mapping two lists variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"assert_one_to_one( dataset, vars1, vars2, dataset_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_one_to_one\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"dataset Dataset checked variables specified vars1 vars2 expected. vars1 First list variables vars2 Second list variables dataset_name string indicating label/symbol object checked. Default rlang::caller_arg(dataset). message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"dataset_name\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"error condition meet. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"library(dplyr) library(rlang) df <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 1L ) assert_one_to_one(df, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) df_many <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 3L ) try( assert_one_to_one(df_many, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) ) #> Error in eval(expr, envir) : #> For some values of \"SPECIES\" there is more than one value of \"SPECIESN\" #> ℹ Call `admiral::get_one_to_many_dataset()` to get all one-to-many values. try( assert_one_to_one(df_many, vars1 = exprs(SPECIESN), vars2 = exprs(SPECIES)) ) #> Error in eval(expr, envir) : #> There is more than one value of \"SPECIESN\" for some values of \"SPECIES\" #> ℹ Call `admiral::get_many_to_one_dataset()` to get all many-to-one values."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"Checks parameter (PARAMCD) exist dataset.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"assert_param_does_not_exist( dataset, param, arg_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_param_does_not_exist\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"dataset data.frame param Parameter code check arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"function throws error parameter exists input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_param_does_not_exist(advs, param = \"HR\") try(assert_param_does_not_exist(advs, param = \"WEIGHT\")) #> Error in eval(expr, envir) : #> The parameter code \"WEIGHT\" already exists in dataset `advs`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"Checks argument object inheriting S3 class specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"assert_s3_class( arg, cls, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_s3_class\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"arg function argument checked cls S3 class check optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"function throws error arg object inherit class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"example_fun <- function(obj) { assert_s3_class(obj, \"factor\") } example_fun(as.factor(letters)) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `obj` must be class , but is a character vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `obj` must be class , but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Are All Argument of the Same Type? — assert_same_type","title":"Are All Argument of the Same Type? — assert_same_type","text":"Checks arguments type.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"assert_same_type( ..., .message = c(\"Arguments {.arg {arg_names}} must be the same type.\", i = paste(\"Argument types are\", paste0(\"{.arg \", arg_names, \"} {.cls \", types, \"}\", collapse = \", \"))), .class = \"assert_same_type\", .call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Are All Argument of the Same Type? — assert_same_type","text":"... Arguments checked .message character vector passed cli_abort(message) assertion fails. .class character vector passed cli_abort(class) assertion fails. .call environment passed cli_abort(call) assertion fails.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Are All Argument of the Same Type? — assert_same_type","text":"function throws error arguments type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"example_fun <- function(true_value, false_value, missing_value) { assert_same_type(true_value, false_value, missing_value) } example_fun( true_value = \"Y\", false_value = \"N\", missing_value = NA_character_ ) try(example_fun( true_value = 1, false_value = 0, missing_value = \"missing\" )) #> Error in example_fun(true_value = 1, false_value = 0, missing_value = \"missing\") : #> Arguments `true_value`, `false_value`, and `missing_value` must be the #> same type. #> ℹ Argument types are `true_value` , `false_value` , #> `missing_value` "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Symbol? — assert_symbol","title":"Is an Argument a Symbol? — assert_symbol","text":"Checks argument symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"assert_symbol( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_symbol\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Symbol? — assert_symbol","text":"arg function argument checked. Must symbol. See examples. optional checked argument optional? set FALSE arg NULL error thrown. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Symbol? — assert_symbol","text":"function throws error arg symbol returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~USUBJID, \"DM\", \"01-701-1015\", \"DM\", \"01-701-1016\", ) example_fun <- function(dat, var) { var <- assert_symbol(enexpr(var)) select(dat, !!var) } example_fun(dm, USUBJID) #> # A tibble: 2 × 1 #> USUBJID #> #> 1 01-701-1015 #> 2 01-701-1016 try(example_fun(dm)) #> Error in example_fun(dm) : #> Argument `var` must be a , but is missing. try(example_fun(dm, \"USUBJID\")) #> Error in example_fun(dm, \"USUBJID\") : #> Argument `var` must be a , but is a string. try(example_fun(dm, toupper(PARAMCD))) #> Error in example_fun(dm, toupper(PARAMCD)) : #> Argument `var` must be a , but is a call."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"Checks parameter (PARAMCD) dataset provided expected unit.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"assert_unit( dataset, param, required_unit = NULL, get_unit_expr, arg_name = rlang::caller_arg(required_unit), message = NULL, class = \"assert_unit\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"dataset Dataset checked variable PARAMCD used get_unit_expr expected. param Parameter code parameter check required_unit Expected unit(s) argument set NULL, checked whether unit unique within parameter. Permitted Values: character vector NULL get_unit_expr Expression used provide unit param arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"function throws error one non-missing unit dataset unit variable differs expected unit observation parameter input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_unit(advs, param = \"WEIGHT\", required_unit = \"kg\", get_unit_expr = VSSTRESU) try( assert_unit( advs, param = \"WEIGHT\", required_unit = c(\"g\", \"mg\"), get_unit_expr = VSSTRESU ) ) #> Error in eval(expr, envir) : #> It is expected that \"WEIGHT\" has unit of \"g\" or \"mg\". In the input #> dataset the unit is \"kg\". # Checking uniqueness of unit only advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85700, \"g\", \"WEIGHT\", 85700 ) try( assert_unit(advs, param = \"WEIGHT\", get_unit_expr = VSSTRESU) ) #> Error in eval(expr, envir) : #> Multiple units \"kg\" and \"g\" found for \"WEIGHT\". Please review and update #> the units."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Variables? — assert_vars","title":"Is an Argument a List of Variables? — assert_vars","text":"Checks argument valid list symbols (e.g., created exprs())","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"assert_vars( arg, expect_names = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_vars\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Variables? — assert_vars","text":"arg function argument checked expect_names argument set TRUE, checked variables named, e.g., exprs(APERSDT = APxxSDT, APEREDT = APxxEDT). optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Variables? — assert_vars","text":"function throws error arg list symbols (e.g., created exprs() returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(by_vars) { assert_vars(by_vars) } example_fun(exprs(USUBJID, PARAMCD)) try(example_fun(quos(USUBJID, PARAMCD))) #> Error in example_fun(quos(USUBJID, PARAMCD)) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 1 is a object, and element 2 is a object try(example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\"))) #> Error in example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\")) : #> Argument `by_vars` must be class , but is a character vector. try(example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL)))) #> Error in example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL))) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 2 is a call, and element 3 is a call example_fun_name <- function(by_vars) { assert_vars(by_vars, expect_names = TRUE) } example_fun_name(exprs(APERSDT = APxxSDT, APEREDT = APxxEDT)) try(example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT))) #> Error in example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT)) : #> All elements of `by_vars` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Variable-Value List? — assert_varval_list","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"Checks argument list expressions expressions variable-value pairs. value can symbol, string, numeric, expression, NA.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"assert_varval_list( arg, required_elements = NULL, accept_expr = TRUE, accept_var = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_varval_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"arg function argument checked required_elements character vector names must present arg accept_expr expressions right hand side accepted? accept_var unnamed variable names (e.g. exprs(USUBJID)) right hand side accepted? optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"function throws error arg list variable-value expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(vars) { assert_varval_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ)) : #> Argument `vars` must be a named list of expressions where each element #> is a symbol, character scalar, numeric scalar, an expression, or NA, but is a #> list. #> ℹ To create a list of expressions use `exprs()`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Backquotes — backquote","title":"Wrap a String in Backquotes — backquote","text":"Wrap String Backquotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Backquotes — backquote","text":"","code":"backquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Backquotes — backquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Backquotes — backquote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"check argument contains valid variable(s) created exprs() Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"","code":"contains_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"arg function argument checked","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"TRUE variables valid variable","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"Helper Function Convert Date (Date-time) Objects Characters dtc Format (-DTC type variable)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"","code":"convert_dtm_to_dtc(dtm)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"dtm date date-time","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":null,"dir":"Reference","previous_headings":"","what":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"Output dataset vignette pre-specified admiral format.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"","code":"dataset_vignette(dataset, display_vars = NULL, filter = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"dataset Dataset output vignette display_vars Variables selected demonstrate outcome derivation Permitted Values: list variables Default NULL display_vars NULL, selected variables visible vignette variables hidden. can made visible clicking theChoose columns display button. filter Filter condition specified condition applied dataset displayed. Permitted Values: condition","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"HTML table","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecation with Soft Message — deprecate_inform","title":"Deprecation with Soft Message — deprecate_inform","text":"Wrapper around lifecycle::deprecate_soft() messages users deprecated features functions instead warning.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"deprecate_inform( when, what, with = NULL, details = NULL, id = NULL, env = rlang::caller_env(), user_env = rlang::caller_env(2) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecation with Soft Message — deprecate_inform","text":"string giving version behaviour deprecated. string describing deprecated: Deprecate whole function \"foo()\". Deprecate argument \"foo(arg)\". Partially deprecate argument \"foo(arg = 'must scalar integer')\". Deprecate anything else custom message wrapping (). can optionally supply namespace: \"ns::foo()\", usually needed inferred caller environment. optional string giving recommended replacement deprecated behaviour. takes form . details cases deprecation message can automatically generated . , use details provide hand-written message. details can either single string character vector, converted bulleted list. default, info bullets used. Provide named vectors override. id id deprecation. warning issued id. Defaults generated message, give unique ID message details built programmatically depends inputs, like deprecate multiple functions warn . env, user_env Pair environments define deprecate_*() called (used determine package name) function called deprecating function called (used determine deprecate_soft() message). needed calling deprecate_*() internal helper, case forward env = caller_env() user_env = caller_env(2).","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecation with Soft Message — deprecate_inform","text":"NULL, invisibly.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"# A Phase 1 deprecated function with custom bulleted list: deprecate_inform( when = \"1.0.0\", what = \"foo()\", details = c( x = \"This message will turn into a warning with release of x.y.z\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Double Quotes — dquote","title":"Wrap a String in Double Quotes — dquote","text":"Wrap string double quotes, e.g., displaying character values messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Double Quotes — dquote","text":"","code":"dquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Double Quotes — dquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Double Quotes — dquote","text":"input NULL, text \"NULL\" returned. Otherwise, input double quotes returned.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate Multiple Elements — enumerate","title":"Enumerate Multiple Elements — enumerate","text":"Enumerate multiple elements vector list.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(x, quote_fun = backquote, conjunction = \"and\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate Multiple Elements — enumerate","text":"x vector list quote_fun Quoting function, defaults backquote. set NULL, elements quoted. conjunction Character used message, defaults \"\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate Multiple Elements — enumerate","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(c(\"one\", \"two\", \"three\")) #> Warning: `enumerate()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.val {letters[1:3]}}')` #> [1] \"`one`, `two` and `three`\" enumerate(c(1, 2, 3), quote_fun = NULL) #> [1] \"1, 2 and 3\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"Uses diffdf::diffdf() compares 2 datasets differences. function can thought R-equivalent SAS proc compare useful tool unit testing well.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"expect_dfs_equal(base, compare, keys, ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"base Input dataset compare Comparison dataset keys character vector variables define unique row base compare datasets ... Additional arguments passed onto diffdf::diffdf()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"error base compare match NULL invisibly ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"library(dplyr, warn.conflicts = FALSE) tbl1 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 19, \"F\", \"1003\", 20, \"M\", \"1004\", 18, \"F\" ) tbl2 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 18.9, \"F\", \"1003\", 20, NA ) try(expect_dfs_equal(tbl1, tbl2, keys = \"USUBJID\")) #> Error : Differences found between the objects! #> #> Summary of BASE and COMPARE #> ================================================================== #> PROPERTY BASE COMP #> ------------------------------------------------------------------ #> Name base compare #> Class \"tbl_df, tbl, data.frame\" \"tbl_df, tbl, data.frame\" #> Rows(#) 4 3 #> Columns(#) 3 3 #> ------------------------------------------------------------------ #> #> #> There are rows in BASE that are not in COMPARE !! #> ========= #> USUBJID #> --------- #> 1004 #> --------- #> #> #> Not all Values Compared Equal #> ============================= #> Variable No of Differences #> ----------------------------- #> AGE 1 #> SEX 1 #> ----------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> AGE 1002 19 18.9 #> ---------------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> SEX 1003 M #> ---------------------------------- #> #> tlb3 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1004\", 18, \"F\", \"1003\", 20, \"M\", \"1002\", 19, \"F\", \"1001\", 18, \"M\", ) # Note the sorting order of the keys is not required expect_dfs_equal(tbl1, tlb3, keys = \"USUBJID\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":null,"dir":"Reference","previous_headings":"","what":"Concatenate One or More Expressions — expr_c","title":"Concatenate One or More Expressions — expr_c","text":"Concatenate One Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concatenate One or More Expressions — expr_c","text":"","code":"expr_c(...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concatenate One or More Expressions — expr_c","text":"... One expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concatenate One or More Expressions — expr_c","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract All Symbols from a List of Expressions — extract_vars","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"Extract Symbols List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"extract_vars(x, side = \"lhs\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"x R object side One \"lhs\" (default) \"rhs\" formulas","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"library(rlang) extract_vars(exprs(PARAMCD, (BASE - AVAL) / BASE + 100)) #> [[1]] #> PARAMCD #> #> [[2]] #> BASE #> #> [[3]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1) #> [[1]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1, side = \"rhs\") #> [[1]] #> ARMCD #> #> [[2]] #> AGEGR1 #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Optional Filter — filter_if","title":"Optional Filter — filter_if","text":"Filters input dataset provided expression NULL","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optional Filter — filter_if","text":"","code":"filter_if(dataset, filter)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Optional Filter — filter_if","text":"dataset Input dataset filter filter condition. Must expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Optional Filter — filter_if","text":"data.frame containing rows dataset matching filter just dataset filter NULL","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Return English-friendly messaging for object-types — friendly_type_of","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"Return English-friendly messaging object-types","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"","code":"friendly_type_of(x, value = TRUE, length = FALSE)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"x R object. value Whether describe value x. length Whether mention length vectors lists.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"string describing type. Starts indefinite article, e.g. \"integer vector\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"helper function aids us forming user-friendly messages gets called what_is_it(), often used assertion functions identify object-type user passed argument instead expected-type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Constant Variables — get_constant_vars","title":"Get Constant Variables — get_constant_vars","text":"Get Constant Variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Constant Variables — get_constant_vars","text":"","code":"get_constant_vars(dataset, by_vars, ignore_vars = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Constant Variables — get_constant_vars","text":"dataset data frame. by_vars variables groups defined variables considered separately. .e., variable constant within group, returned. ignore_vars Variables ignore specified variables considered, .e., returned even constant (unless included variables). Permitted Values: list variable names selector function calls like starts_with(\"EX\")","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Constant Variables — get_constant_vars","text":"Variable vector.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Retrieve Dataset admiraldev_environment environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"","code":"get_dataset(name)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"name name dataset retrieve","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Sometimes, developers may want provide information users fit warning error message. example, input dataset function contains unexpected records, can stored separate dataset, users can access investigate issue. achieve , R data structure known 'environment'. environment objects created build time, can populated values package loaded update values course R session. , establishment admiraldev_environment allows us create dynamic data/objects based user-inputs need modification. purpose get_dataset retrieve datasets contained inside admiraldev_environment. Currently support two datasets inside admiraldev_environment object: one_to_many many_to_one","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Duplicates From a Vector — get_duplicates","title":"Get Duplicates From a Vector — get_duplicates","text":"Get Duplicates Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Duplicates From a Vector — get_duplicates","text":"x atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Duplicates From a Vector — get_duplicates","text":"vector type x contain duplicate values","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(1:10) #> integer(0) get_duplicates(c(\"a\", \"a\", \"b\", \"c\", \"d\", \"d\")) #> [1] \"a\" \"d\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"Get New Temporary Variable Name Dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"get_new_tmp_var(dataset, prefix = \"tmp_var\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"dataset input dataset prefix prefix new temporary variable name create","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"name new temporary variable symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"function returns new unique temporary variable name used inside dataset. temporary variable names structure prefix_n n integer, e.g. tmp_var_1. already variable inside datset given prefix suffix increased 1, e.g. tmp_var_1 already exists get_new_tmp_var() return tmp_var_2.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) tmp_var <- get_new_tmp_var(dm) mutate(dm, !!tmp_var := NA) #> # A tibble: 2 × 4 #> DOMAIN STUDYID USUBJID tmp_var_1 #> #> 1 DM STUDY X 01-701-1015 NA #> 2 DM STUDY X 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Source Variables from a List of Expressions — get_source_vars","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"Get Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"","code":"get_source_vars(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":null,"dir":"Reference","previous_headings":"","what":"Negated Value Matching — %notin%","title":"Negated Value Matching — %notin%","text":"Returns logical vector indicating match left operand right operand.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Negated Value Matching — %notin%","text":"","code":"x %notin% table"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Negated Value Matching — %notin%","text":"x values matched table values matched ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Negated Value Matching — %notin%","text":"logical vector","code":""},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Or — %or%","text":"","code":"lhs %or% rhs"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Or — %or%","text":"lhs valid R expression rhs valid R expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Or — %or%","text":"Either result evaluating lhs, rhs error","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Or — %or%","text":"function evaluates expression lhs expression results error, catches error proceeds evaluating expression rhs returns result.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks if the argument equals the auto keyword — is_auto","title":"Checks if the argument equals the auto keyword — is_auto","text":"Checks argument equals auto keyword","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks if the argument equals the auto keyword — is_auto","text":"","code":"is_auto(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks if the argument equals the auto keyword — is_auto","text":"arg argument check","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Checks if the argument equals the auto keyword — is_auto","text":"TRUE argument equals auto keyword, .e., expression symbol named auto.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is order vars? — is_order_vars","title":"Is order vars? — is_order_vars","text":"Check inputs created using exprs() calls involving desc()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is order vars? — is_order_vars","text":"","code":"is_order_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is order vars? — is_order_vars","text":"arg R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is order vars? — is_order_vars","text":"FALSE argument list order vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Is this string a valid DTC — is_valid_dtc","title":"Is this string a valid DTC — is_valid_dtc","text":"string valid DTC","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is this string a valid DTC — is_valid_dtc","text":"","code":"is_valid_dtc(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is this string a valid DTC — is_valid_dtc","text":"arg character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is this string a valid DTC — is_valid_dtc","text":"TRUE argument valid --DTC string, FALSE otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":null,"dir":"Reference","previous_headings":"","what":"Join Functions — anti_join","title":"Join Functions — anti_join","text":"*_join() functions {dplyr} without warning different attributes datasets.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Join Functions — anti_join","text":"","code":"anti_join(x, y, by = NULL, copy = FALSE, ...) inner_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...) left_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Join Functions — anti_join","text":"x data.frame y data.frame character vector copy logical ... Additional arguments suffix character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Join Functions — anti_join","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Process set_values_to Argument — process_set_values_to","title":"Process set_values_to Argument — process_set_values_to","text":"function creates variables specified set_values_to argument, catches errors, provides user friendly error messages, optionally checks type created variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"process_set_values_to(dataset, set_values_to = NULL, expected_types = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process set_values_to Argument — process_set_values_to","text":"dataset Input dataset set_values_to Variables set named list returned exprs() defining variables set, e.g. exprs(PARAMCD = \"OS\", PARAM = \"Overall Survival\") expected. values must symbols, character strings, numeric values, expressions, NA. expected_types argument specified, specified variables checked whether specified type matches type variables created set_values_to. Permitted Values: character vector values \"numeric\" \"character\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process set_values_to Argument — process_set_values_to","text":"input dataset variables specified set_values_to added/updated","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"library(dplyr) data <- tribble( ~AVAL, 20 ) try( process_set_values_to( data, set_values_to = exprs( PARAMCD = BMI ) ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = BMI)) : #> Assigning variables failed! #> • `set_values_to = exprs(PARAMCD = BMI)` #> See error message below: #> ℹ In argument: `PARAMCD = BMI`. Caused by error: ! object 'BMI' not found try( process_set_values_to( data, set_values_to = exprs( PARAMCD = 42 ), expected_types = c(PARAMCD = \"character\") ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = 42), : #> The following variables have an unexpected type: #> • PARAMCD: expected is , but it is ."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"Remove Temporary Variables Created Within Current Function Environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"remove_tmp_vars(dataset)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"dataset input dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"input dataset temporary variables removed","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) dm <- select(dm, USUBJID) tmp_var <- get_new_tmp_var(dm) dm <- mutate(dm, !!tmp_var := NA) ## This function creates two new temporary variables which are removed when calling ## `remove_tmp_vars()`. Note that any temporary variable created outside this ## function is **not** removed do_something <- function(dataset) { tmp_var_1 <- get_new_tmp_var(dm) tmp_var_2 <- get_new_tmp_var(dm) dm %>% mutate(!!tmp_var_1 := NA, !!tmp_var_2 := NA) %>% print() %>% remove_tmp_vars() } do_something(dm) #> # A tibble: 2 × 4 #> USUBJID tmp_var_1 tmp_var_2 tmp_var_3 #> #> 1 01-701-1015 NA NA NA #> 2 01-701-1016 NA NA NA #> # A tibble: 2 × 2 #> USUBJID tmp_var_1 #> #> 1 01-701-1015 NA #> 2 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Symbols in an Expression — replace_symbol_in_expr","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Replace symbols expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"replace_symbol_in_expr(expression, target, replace)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression Expression target Target symbol replace Replacing symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression every occurrence symbol target replaced replace","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Stefan Bundfuss","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"library(rlang) replace_symbol_in_expr(expr(AVAL), target = AVAL, replace = AVAL.join) #> AVAL.join replace_symbol_in_expr(expr(AVALC), target = AVAL, replace = AVAL.join) #> AVALC replace_symbol_in_expr(expr(desc(AVAL)), target = AVAL, replace = AVAL.join) #> desc(AVAL.join)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Expression Value with Name — replace_values_by_names","title":"Replace Expression Value with Name — replace_values_by_names","text":"Replace Expression Value Name","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"replace_values_by_names(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Expression Value with Name — replace_values_by_names","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Expression Value with Name — replace_values_by_names","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"library(rlang) replace_values_by_names(exprs(AVAL, ADT = convert_dtc_to_dt(EXSTDTC))) #> [[1]] #> AVAL #> #> $ADT #> ADT #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Single Quotes — squote","title":"Wrap a String in Single Quotes — squote","text":"Wrap String Single Quotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Single Quotes — squote","text":"","code":"squote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Single Quotes — squote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Single Quotes — squote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":null,"dir":"Reference","previous_headings":"","what":"Suppress Specific Warnings — suppress_warning","title":"Suppress Specific Warnings — suppress_warning","text":"Suppress certain warnings issued expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Suppress Specific Warnings — suppress_warning","text":"","code":"suppress_warning(expr, regexpr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Suppress Specific Warnings — suppress_warning","text":"expr Expression executed regexpr Regular expression matching warnings suppress","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Suppress Specific Warnings — suppress_warning","text":"Return value expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Suppress Specific Warnings — suppress_warning","text":"warnings issued expression match regular expression suppressed.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":null,"dir":"Reference","previous_headings":"","what":"Valid Time Units — valid_time_units","title":"Valid Time Units — valid_time_units","text":"Contains acceptable character vector valid time units","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Valid Time Units — valid_time_units","text":"","code":"valid_time_units()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Valid Time Units — valid_time_units","text":"character vector valid time units","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn a List of Expressions into a Character Vector — vars2chr","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"Turn List Expressions Character Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"vars2chr(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"expressions list expressions created using exprs()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) vars2chr(exprs(USUBJID, AVAL)) #> #> \"USUBJID\" \"AVAL\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn if incomplete dtc — warn_if_incomplete_dtc","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"Warn incomplete dtc","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"","code":"warn_if_incomplete_dtc(dtc, n)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"dtc character vector date-times ISO 8601 format n non-negative integer","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"warning dtc contains partial dates","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"Checks two list inputs names number elements issues warning otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"warn_if_inconsistent_list(base, compare, list_name, i = 2)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"base named list compare named list list_name string name list index id compare 2 lists","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"warning 2 lists different names length","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) # no warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) # warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ, DTHVAR = \"text\"), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) #> Warning: The variables used for traceability in `Test` are not consistent, please check: #> source 1 , Variables are given as: DTHDOM DTHSEQ DTHVAR #> source 2 , Variables are given as: DTHDOM DTHSEQ"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"Warn vector contains unknown datetime format \"2003-12-15T-:15:18\", \"2003-12-15T13:-:19\",\"–12-15\",\"—–T07:15\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"warn_if_invalid_dtc(dtc, is_valid = is_valid_dtc(dtc))"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"dtc character vector containing dates is_valid logical vector indicating whether elements dtc valid","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"## No warning as `dtc` is a valid date format warn_if_invalid_dtc(dtc = \"2021-04-06\") ## Issues a warning warn_if_invalid_dtc(dtc = \"2021-04-06T-:30:30\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Variable Already Exists — warn_if_vars_exist","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"Warn variable already exists inside dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"warn_if_vars_exist(dataset, vars)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"dataset data.frame vars character vector columns check dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~USUBJID, ~ARM, \"01-701-1015\", \"Placebo\", \"01-701-1016\", \"Placebo\", ) ## No warning as `AAGE` doesn't exist in `dm` warn_if_vars_exist(dm, \"AAGE\") ## Issues a warning warn_if_vars_exist(dm, \"ARM\") #> Warning: Variable \"ARM\" already exists in the dataset."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":null,"dir":"Reference","previous_headings":"","what":"What Kind of Object is This? — what_is_it","title":"What Kind of Object is This? — what_is_it","text":"Returns string describing kind object input .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"What Kind of Object is This? — what_is_it","text":"x R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"What Kind of Object is This? — what_is_it","text":"character description type x","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(\"abc\") #> Warning: `what_is_it()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.obj_type_friendly {letters}}')`. #> [1] \"`\\\"abc\\\"`\" what_is_it(1L) #> [1] \"`1`\" what_is_it(1:10) #> [1] \"an integer vector\" what_is_it(mtcars) #> [1] \"a data frame\""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-development-version","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev (development version)","text":"following function arguments entering next phase deprecation process: (#2487) (#2595) Phase 1 (message) Phase 2 (warning) Phase 3 (error) Phase 4 (removed)","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-1-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 1.2.0","text":"New Function deprecate_inform() wrapper around lifecycle::deprecate_soft() allow control messaging. (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-2-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.2.0","text":"Objects passed assert_list_element() via ... argument can now used glue expression specified message_text argument. (#469) required_unit argument assert_unit() enhanced. now possible specify one unit specify . latter case uniqueness unit checked. (#468) assert_numeric_vector() function gained optional length argument check whether vector specific length. (#473)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.2.0","text":"admiraldev compatible R version >=4.1 (#456) following function arguments entering next phase deprecation process: (#459) Phase 1 (message) functions arguments Phase Phase 2 (warning) functions arguments Phase Phase 3 (error) functions arguments Phase Phase 4 (removed) argument quosures removed functions vars2chr(quosures), replace_values_by_names(quosures), get_source_vars(quosures) Removed v1.0.0 assert_named_expr() Removed v1.0.0 assert_has_variables() Removed v1.0.0 assert_function_param()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.2.0","text":"Deprecation Strategy updated long haul! (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-1-2-0","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev 1.2.0","text":"devcontainer files removed (#480)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-110","dir":"Changelog","previous_headings":"","what":"admiraldev 1.1.0","title":"admiraldev 1.1.0","text":"CRAN release: 2024-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.1.0","text":"Updated arg_name parameter assert_filter_cond, assert_symbol, assert_expr gsub(\"^enexpr\\\\((\\\\w+)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)) argument error messages return quoted argument without enexpr(), e.g. filter_add instead enexpr(filter_add). (#2404) Error messaging throughout package updated rlang::abort() cli::cli_abort(). part update, assert_*() functions new arguments assert_*(message, arg_name, call, class). (#367) Warning messaging also updated use cli messaging.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.1.0","text":"renv related files removed. (#360) longer exporting is_named() function. (#401) pharmaversesdtm removed dependency. (#434) part error messaging update, following changes made. assert_s3_class(class) argument renamed assert_s3_class(cls). (#367) Functions arg_name(), enumerate(), what_is_it(), friendly_type_of() deprecated warning returned developer using functions. developer functions (opposed functions typical admiral users), use short deprecation cycle.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.1.0","text":"“Release Strategy” vignette updated respect new branching strategy. (#353) “Release Strategy” vignette now contains short new “Release Tracking” section linking external dashboard CRAN packages awaiting release. (#358)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-1-1-0","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev 1.1.0","text":"Removed dependencies needed build package package documentation. (#426) Increased minimum R version required 4.0 match {admiral}. (#382) addin_format_testthat addin moved {pharmaverse4devs} package. (#419)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-100","dir":"Changelog","previous_headings":"","what":"admiraldev 1.0.0","title":"admiraldev 1.0.0","text":"CRAN release: 2023-12-15","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-0-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.0.0","text":"assert_function() now accepts function arguments ellipsis, ... function formals (#339)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.0.0","text":"assert_function_param() assert_named_expr() assert_has_variables()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-0-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.0.0","text":"New documentation programming strategy around quoting/expressions standardizing roxygen texts (#233, #332) New documentation use footnotes writing vignettes (#324) Updated language images adopt GitHub Flow Strategy (#349)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-050","dir":"Changelog","previous_headings":"","what":"admiraldev 0.5.0","title":"admiraldev 0.5.0","text":"CRAN release: 2023-09-11","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-5-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.5.0","text":"Calls admiral.test swapped pharmaversesdtm (#321) New vignette package writing extensions now available (#295, #312) New vignette creating test data now available (#282)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-5-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.5.0","text":"messaging warn_if_invalid_dtc() updated align date/datetime functions admiral currently . (#316)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.5.0","text":"assert_order_vars() quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names(), get_source_vars(), vars2chr(). (#288) assert_function_param() deprecated favor assert_function(). (#264) assert_named_expr() deprecated favor assert_expr_list(). (#264) assert_has_variables() deprecated favor assert_data_frame(). (#264)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-5-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.5.0","text":"Guidance around issues merging updated (#286) Common R CMD troubleshooting made separate vignette (#286) Documentation get_dataset() improved. (#271) Minor updates programming strategy added (#213, #240, #260) Updated unit testing vignette snapshot testing guidance. (#302) Documentation friendly_type_of() provided (#22) Minor updates pull request review guidance added (#201, #292) Documentation singular versus plural function argument names added programming strategy vignette. Also documentation common arguments missing_value missing_values added. (#296) Documentation highlighting difference set_values_to keep_source_vars (#318) List common arguments updated (#306)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-040","dir":"Changelog","previous_headings":"","what":"admiraldev 0.4.0","title":"admiraldev 0.4.0","text":"CRAN release: 2023-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-4-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.4.0","text":"New function assert_named() check elements argument named (#241) New function assert_expr_list() check argument list expressions (#241) Added Report bug link admiraldev website (#257)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.4.0","text":"assert_order_vars() deprecated favor assert_expr_list(). (#241) following functions deprecated previous admiral versions using next phase deprecation process: (#272) quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names().","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-4-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.4.0","text":"deprecation strategy updated regarding unit tests deprecated functions/arguments phase 1. (#247) programming strategy updated regarding permitted values calling functions package dependencies (#72, #253)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-030","dir":"Changelog","previous_headings":"","what":"admiraldev 0.3.0","title":"admiraldev 0.3.0","text":"CRAN release: 2023-03-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-3-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.3.0","text":"New function process_set_values_to() creating variables specified set_value_to argument catching errors (#70)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-3-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.3.0","text":"Using testthat3e (testthat 3rd edition) unit testing. stricter messages must addressed deprecated functions throw errors. (#230) Slight boost test coverage dev_utilities (#102) Fix datatable styling documentation (#197) assert_character_vector() function gained named argument check elements vector named. (#70) assert_list_of() function gained named argument check elements list named. (#203) quote_fun argument enumerate() extended NULL can specified request quoting elements. (#203) assert_list_of() function enhanced also considers type element, e.g., check value list symbols. (#208)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.3.0","text":"default value optional argument assert_date_vector(), assert_list_of(), assert_s3_class() changed TRUE FALSE make default behavior consistent. (#87) quo_c() replace_symbol_in_quo() quosures argument get_source_vars(), replace_values_by_names(), vars2chr()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-3-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.3.0","text":"New section programming strategy regarding comments (#71) Removed requirement add @author tags code scripts programming strategy, tracking authors DESCRIPTION file. Authors removed function documentation line update. (#206, #210) Removed -boarding Issue Template (#225) Increased clarity scope package (#232)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-020","dir":"Changelog","previous_headings":"","what":"admiraldev 0.2.0","title":"admiraldev 0.2.0","text":"CRAN release: 2022-11-30","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.2.0","text":"Developer addin formatting tests admiral programming standards (#73) New functions replace_symbol_in_quo() add_suffix_to_vars() (#106) New function assert_atomic_vector() (#98) New keyword/family create_aux functions creating auxiliary datasets (#126) New function assert_date_vector() (#129) New function assert_same_type() (#176) Remove dependency {assertthat} (#149) Test coverage admiraldev increased 45% approximately 100% (#94, #95, #96, #98, #101, #103) Environment objects consolidated single admiraldev_environment object R/admiraldev_environment.R. (#179)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.2.0","text":"expect_names argument added assert_vars() check variables named (#117) Remove dplyr function exports migration user facing function negate_vars() admiral (#83)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.2.0","text":"longer compatible admiral (<0.9)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.2.0","text":"New vignette package release strategy (#79) Updated multiple roxygen headers (#116, #133, #134, #141, #145, #172) Description admiral options work certain function inputs, .e subject_keys (#133)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-2-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.2.0","text":"PR Checklist Template updated (#172) New authors/contributors (#158)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-010","dir":"Changelog","previous_headings":"","what":"admiraldev 0.1.0","title":"admiraldev 0.1.0","text":"CRAN release: 2022-08-26","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-1-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.1.0","text":"Developer specific functions brought admiral Developer specific vignettes brought admiral New admiraldev website created","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-1-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.1.0","text":"NA","code":""}]
> checking package dependencies ... ERROR - Namespace dependency not required: ‘pkg’
Add pkg to the Imports or Suggests field in the DESCRIPTION file. In general, dependencies should be listed in the Imports @@ -152,7 +152,7 @@
pkg
Imports
Suggests
DESCRIPTION
❯ checking R code for possible problems ... NOTE - function_xyz: no visible binding for global variable ‘some_var’
Add some_var to the list of “global” variables in R/globals.R.
some_var
R/globals.R
❯ checking Rd \usage sections ... WARNING Undocumented arguments in documentation object 'function_xyz' - ‘some_param’
Add an @param some_param section in the header of function_xyz() and run devtools::document() afterwards.
@param some_param
function_xyz()
devtools::document()
Straub B, Bundfuss S, Dickinson J, Farrugia R, Gautier F, Mancini E, Mascary S, Miller G, Sjoberg D, Thoma S, Zhang K, Zhu Z (2025). admiraldev: Utility Functions and Development Tools for the Admiral Package Family. -R package version 1.1.0.9008, +R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/, https://pharmaverse.github.io/admiraldev/.
@Manual{, title = {admiraldev: Utility Functions and Development Tools for the Admiral Package Family}, author = {Ben Straub and Stefan Bundfuss and Jeffrey Dickinson and Ross Farrugia and Fanny Gautier and Edoardo Mancini and Sadchla Mascary and Gordon Miller and Daniel Sjoberg and Stefan Thoma and Kangjie Zhang and Zelos Zhu}, year = {2025}, - note = {R package version 1.1.0.9008, + note = {R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/}, url = {https://pharmaverse.github.io/admiraldev/}, }
The following function arguments are entering the next phase of the deprecation process: (#2487) (#2595)
Phase 1 (message)
Phase 2 (warning)
Phase 3 (error)
Phase 4 (removed)
deprecate_inform()
lifecycle::deprecate_soft()
Objects passed to assert_list_element() via the ... argument can now be used in the glue expression specified for the message_text argument. (#469)
assert_list_element()
...
message_text
The required_unit argument of assert_unit() has been enhanced. It is now possible to specify more than one unit or not specify it at all. In the latter case only the uniqueness of the unit is checked. (#468)
required_unit
assert_unit()
The assert_numeric_vector() function gained an optional length argument to check whether the vector has a specific length. (#473)
assert_numeric_vector()
length
admiraldev is only compatible with R version >=4.1 (#456)
The following function arguments are entering the next phase of the deprecation process: (#459)
devcontainer
``` vs1 <- vs %>% derive_vars_dt( new_vars_prefix = \"A\", dtc = VSDTC, date_imputation = \"first\" ) ``` r dataset_vignette( vs1, display_vars = exprs(USUBJID, VSTESTCD, VISIT, VSDTC, ADT), filter = VSTESTCD == \"WEIGHT\" ) ```"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"using-footnotes","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Using Footnotes","title":"Writing Vignettes","text":"Footnotes can useful add context without adding clutter primary subject matter vignette written. use footnotes, add caret identifier inside brackets e.g. ([^1]). identifiers can numbers words, can’t contain spaces tabs. following markdown text render follows: example 1","code":"Here is an example [^1] [^1]: Cool note about the example."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"conventions-for-adam-workflow","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Conventions for ADaM Workflow","title":"Writing Vignettes","text":"vignettes describing ADaM workflow, second section summarize programming workflow. first sub-section within workflow always describe data read demonstrate use admiral functions, sub-section within programming workflow tagged (e.g. [Step1] (#step)), user can go relevant section programming workflow (addition Table contents). Don’t use tag number use meaningful name (e.g. use (#link1), use (#this_action)) last section link template script. ADSL variables ADSL variables required derivation merged SDTM dataset first derivation. ADSL variables added -variables derivations add observations. ensures ADSL variables populated new observations. adsl_vars variable created beginning script added by_vars parameter derivations add observations. ADSL variables final dataset required derivation merged dataset last derivation.","code":"# Programming Workflow * [Read in Data](#readdata) * [Derive/Impute End and Start Analysis Date/time and Relative Day](#datetime) * ... * [Assign `ASEQ`](#aseq) ## Read in Data {#readdata} ## Derive/Impute End and Start Analysis Date/time and Relative Day {#datetime} ## ... ## Assign `ASEQ` {#aseq} # Another Section # Example Script ADaM | Sample Code ---- | -------------- ADxx | [ad_adxx.R](https://github.com/pharmaverse/admiral/blob/main/inst/templates/ad_adxx.R){target=\"_blank\"}"},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ben Straub. Author, maintainer. Stefan Bundfuss. Author. Jeffrey Dickinson. Author. Ross Farrugia. Author. Fanny Gautier. Author. Edoardo Mancini. Author. Sadchla Mascary. Author. Gordon Miller. Author. Daniel Sjoberg. Author. Stefan Thoma. Author. Kangjie Zhang. Author. Zelos Zhu. Author. F. Hoffmann-La Roche AG. Copyright holder, funder. GlaxoSmithKline LLC. Copyright holder, funder.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Straub B, Bundfuss S, Dickinson J, Farrugia R, Gautier F, Mancini E, Mascary S, Miller G, Sjoberg D, Thoma S, Zhang K, Zhu Z (2025). admiraldev: Utility Functions Development Tools Admiral Package Family. R package version 1.1.0.9008, https://github.com/pharmaverse/admiraldev/, https://pharmaverse.github.io/admiraldev/.","code":"@Manual{, title = {admiraldev: Utility Functions and Development Tools for the Admiral Package Family}, author = {Ben Straub and Stefan Bundfuss and Jeffrey Dickinson and Ross Farrugia and Fanny Gautier and Edoardo Mancini and Sadchla Mascary and Gordon Miller and Daniel Sjoberg and Stefan Thoma and Kangjie Zhang and Zelos Zhu}, year = {2025}, note = {R package version 1.1.0.9008, https://github.com/pharmaverse/admiraldev/}, url = {https://pharmaverse.github.io/admiraldev/}, }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"admiraldev-","dir":"","previous_headings":"","what":"Utility Functions and Development Tools for the Admiral Package Family","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Utility Functions Development Tools Admiral Package Family","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"purpose","dir":"","previous_headings":"","what":"Purpose","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Functions, tools documentation developing core admiral extension package functions. functions admiraldev around testing inputs going functions. also additional quality life functions/Addins assist developers admiral admiral extension packages, functions help rendering documentation, Developer Guides developing function using GitHub, GitHub Actions. NOTE: package intended standalone use rather central dependency admiral extension packages","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"package available CRAN can installed running install.packages(\"admiraldev\"). install latest development version package directly GitHub use following code:","code":"if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_github(\"pharmaverse/admiraldev\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"release-schedule","dir":"","previous_headings":"","what":"Release Schedule","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"admiraldev released CRAN time official release admiral. can find release schedule admiral packages .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Along authors contributors, thanks following people work package: Ania Golab, Samia Kabi, Pooja Kumari, Syed Mubasheer, Thomas Neitmann Ondrej Slama.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"Add suffix variables list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"add_suffix_to_vars(order, vars, suffix)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"order List expressions Permitted Values: list variables desc() function calls created exprs(), e.g., exprs(ADT, desc(AVAL)) vars Variables change Permitted Values: list variables created exprs() suffix Suffix Permitted Values: character scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"list expression element suffix (suffix) added every symbol specified vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) add_suffix_to_vars(exprs(ADT, desc(AVAL), AVALC), vars = exprs(AVAL), suffix = \".join\") #> [[1]] #> ADT #> #> [[2]] #> desc(AVAL.join) #> #> [[3]] #> AVALC #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":null,"dir":"Reference","previous_headings":"","what":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Utility functions check data, variables conditions functions used 'admiral' 'admiral' extension packages. Additional utility helper functions assist developers maintaining documentation, testing general upkeep 'admiral' 'admiral' extension packages.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Maintainer: Ben Straub ben.x.straub@gsk.com Authors: Stefan Bundfuss (ORCID) Jeffrey Dickinson Ross Farrugia Fanny Gautier Edoardo Mancini (ORCID) Sadchla Mascary Gordon Miller Daniel Sjoberg (ORCID) Stefan Thoma (ORCID) Kangjie Zhang Zelos Zhu contributors: F. Hoffmann-La Roche AG [copyright holder, funder] GlaxoSmithKline LLC [copyright holder, funder]","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract Argument Name from an Expression — arg_name","title":"Extract Argument Name from an Expression — arg_name","text":"Extract Argument Name Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract Argument Name from an Expression — arg_name","text":"","code":"arg_name(expr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract Argument Name from an Expression — arg_name","text":"expr expression created inside function using substitute()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract Argument Name from an Expression — arg_name","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Atomic Vector? — assert_atomic_vector","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"Checks argument atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"assert_atomic_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_atomic_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"function throws error arg atomic vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"example_fun <- function(x) { assert_atomic_vector(x) } example_fun(1:10) try(example_fun(list(1, 2))) #> Error in example_fun(list(1, 2)) : #> Argument `x` must be an atomic vector, but is a list."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Scalar (String)? — assert_character_scalar","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"Checks argument character scalar (optionally) whether matches one provided values.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"assert_character_scalar( arg, values = NULL, case_sensitive = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"arg function argument checked values character vector valid values arg. Values converted lower case vector case_sensitive = FALSE used. case_sensitive argument handled case-sensitive? set FALSE, argument converted lower case checking permitted values returning argument. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"function throws error arg character vector arg character vector length > 1 value one values specified. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"example_fun <- function(msg_type) { assert_character_scalar(msg_type, values = c(\"warning\", \"error\")) } example_fun(\"warning\") try(example_fun(\"message\")) #> Error in example_fun(\"message\") : #> Argument `msg_type` must be equal to one of \"warning\" or \"error\". try(example_fun(TRUE)) #> Error in example_fun(TRUE) : #> Argument `msg_type` must be a scalar of class , but is #> `TRUE`. # handling arguments case-insensitive example_fun2 <- function(msg_type) { msg_type <- assert_character_scalar( msg_type, values = c(\"warning\", \"error\"), case_sensitive = FALSE ) if (msg_type == \"warning\") { print(\"A warning was requested.\") } } example_fun2(\"Warning\") #> [1] \"A warning was requested.\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Vector? — assert_character_vector","title":"Is an Argument a Character Vector? — assert_character_vector","text":"Checks argument character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"assert_character_vector( arg, values = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Vector? — assert_character_vector","text":"arg function argument checked values character vector valid values arg named set TRUE, error issued elements vector named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Vector? — assert_character_vector","text":"function throws error arg character vector element included list valid values. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"example_fun <- function(chr) { assert_character_vector(chr) } example_fun(letters) try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `chr` must be , but is an integer vector. example_fun2 <- function(chr) { assert_character_vector(chr, named = TRUE) } try(example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\"))) #> Error in example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\")) : #> All elements of `chr` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Data Frame? — assert_data_frame","title":"Is an Argument a Data Frame? — assert_data_frame","text":"Checks argument data frame (optionally) whether contains set required variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"assert_data_frame( arg, required_vars = NULL, check_is_grouped = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_data_frame\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Data Frame? — assert_data_frame","text":"arg function argument checked required_vars list variables created using exprs() check_is_grouped Throw error dataset grouped? Defaults TRUE. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Data Frame? — assert_data_frame","text":"function throws error arg data frame arg data frame misses variable specified required_vars. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"library(dplyr) library(rlang) dm <- tribble( ~STUDYID, ~USUBJID, \"XYZ\", \"1\", \"XYZ\", \"2\" ) example_fun <- function(dataset) { assert_data_frame(dataset, required_vars = exprs(STUDYID, USUBJID)) } example_fun(dm) try(example_fun(select(dm, -STUDYID))) #> Error in example_fun(select(dm, -STUDYID)) : #> Required variable `STUDYID` is missing in `dataset` try(example_fun(\"Not a dataset\")) #> Error in example_fun(\"Not a dataset\") : #> Argument `dataset` must be class , but is a string. try(example_fun(group_by(dm, USUBJID))) #> Error in example_fun(group_by(dm, USUBJID)) : #> Argument `dataset` must not be a grouped dataset, please `ungroup()` it."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"Checks variable dataset date datetime variable","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"assert_date_var( dataset, var, dataset_name = rlang::caller_arg(dataset), var_name = rlang::caller_arg(var), message = NULL, class = \"assert_date_var\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"dataset dataset variable expected var variable check dataset_name name dataset. argument specified, specified name displayed error message. var_name name variable. argument specified, specified name displayed error message. message (string) string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"var_name\" \"dataset_name\", can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"function throws error var date datetime variable dataset returns input invisibly otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"library(lubridate) #> #> Attaching package: ‘lubridate’ #> The following objects are masked from ‘package:base’: #> #> date, intersect, setdiff, union library(dplyr) library(rlang) example_fun <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var(dataset = dataset, var = !!var) } my_data <- tribble( ~USUBJID, ~ADT, \"1\", ymd(\"2020-12-06\"), \"2\", ymd(\"\") ) example_fun( dataset = my_data, var = ADT ) try(example_fun( dataset = my_data, var = USUBJID )) #> Error in example_fun(dataset = my_data, var = USUBJID) : #> Column \"USUBJID\" in dataset `dataset` must be a date or datetime, but is #> a character vector. example_fun2 <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var( dataset = dataset, var = !!var, dataset_name = \"your_data\", var_name = \"your_var\" ) } try(example_fun2( dataset = my_data, var = USUBJID )) #> Error in example_fun2(dataset = my_data, var = USUBJID) : #> Column \"your_var\" in dataset `your_data` must be a date or datetime, but #> is a character vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object a date or datetime vector? — assert_date_vector","title":"Is an object a date or datetime vector? — assert_date_vector","text":"Check object/vector date datetime variable without needing dataset input","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"assert_date_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_date_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object a date or datetime vector? — assert_date_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL function assert_date_vector exits early throw error. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an object a date or datetime vector? — assert_date_vector","text":"function returns error arg missing, date datetime variable otherwise returns invisible output.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"example_fun <- function(arg) { assert_date_vector(arg) } example_fun( as.Date(\"2022-01-30\", tz = \"UTC\") ) try(example_fun(\"1993-07-14\")) #> Error in example_fun(\"1993-07-14\") : #> Argument `arg` must be a date or datetime, but is a string."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is an Expression — assert_expr","title":"Assert Argument is an Expression — assert_expr","text":"Assert Argument Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is an Expression — assert_expr","text":"","code":"assert_expr( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_expr\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is an Expression — assert_expr","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is an Expression — assert_expr","text":"function throws error arg expression, .e. either symbol call, returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Expressions? — assert_expr_list","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"Checks argument list expressions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"assert_expr_list( arg, required_elements = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_expr_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"arg function argument checked required_elements character vector names must present arg named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"function throws error arg list expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"library(rlang) example_fun <- function(vars) { assert_expr_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\")))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\"))) : #> All elements of `vars` must be an expression. #> ℹ `vars[[3]]` = `list(\"a\")` is of type , and `vars[[4]]` = `list(\"a\")` is #> of type "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Filter Condition? — assert_filter_cond","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Argument Filter Condition?","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"assert_filter_cond( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_filter_cond\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"arg Quosure - filtering condition. optional Logical - argument optional? Defaults FALSE. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Performs necessary checks returns arg pass. Otherwise throws informative error.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Check arg suitable filtering condition used functions like subset dplyr::filter.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~STUDYID, ~USUBJID, ~AGE, \"DM\", \"STUDY X\", \"01-701-1015\", 64, \"DM\", \"STUDY X\", \"01-701-1016\", 65, ) # typical usage in a function as an argument check example_fun <- function(dat, x) { x <- assert_filter_cond(enexpr(x), arg_name = \"x\") filter(dat, !!x) } example_fun(dm, AGE == 64) #> # A tibble: 1 × 4 #> DOMAIN STUDYID USUBJID AGE #> #> 1 DM STUDY X 01-701-1015 64 try(assert_filter_cond(mtcars)) #> Error in eval(expr, envir) : #> Argument `mtcars` must be a filter condition, but is a data frame"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Is Argument a Function? — assert_function","title":"Is Argument a Function? — assert_function","text":"Checks argument function expected arguments provided function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is Argument a Function? — assert_function","text":"","code":"assert_function( arg, params = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_function\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is Argument a Function? — assert_function","text":"arg function function checked params character vector character vector expected argument names aforementioned function arg. ellipsis, ..., included function formals function arg, argument, params ignored, accepting values character vector. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is Argument a Function? — assert_function","text":"function throws error argument function function provide arguments specified params argument (assuming ellipsis function formals)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is Argument a Function? — assert_function","text":"","code":"example_fun <- function(fun) { assert_function(fun, params = c(\"x\")) } example_fun(mean) try(example_fun(1)) #> Error in example_fun(1) : #> Argument `fun` must be a function, but is a number. try(example_fun(sum)) #> Error in example_fun(sum) : #> \"x\" is not an argument of the function specified for `fun`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Integer Scalar? — assert_integer_scalar","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"Checks argument integer scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"assert_integer_scalar( arg, subset = \"none\", optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_integer_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"arg function argument checked subset subset integers arg part . one \"none\" (default), \"positive\", \"non-negative\" \"negative\". optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"function throws error arg integer belonging specified subset. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"example_fun <- function(num1, num2) { assert_integer_scalar(num1, subset = \"positive\") assert_integer_scalar(num2, subset = \"negative\") } example_fun(1, -9) try(example_fun(1.5, -9)) #> Error in example_fun(1.5, -9) : #> Argument `num1` must be a positive integer scalar. try(example_fun(2, 0)) #> Error in example_fun(2, 0) : #> Argument `num2` must be a negative integer scalar. try(example_fun(\"2\", 0)) #> Error in example_fun(\"2\", 0) : #> Argument `num1` must be a positive integer scalar."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"Checks elements list named lists/classes fulfill certain condition. , error issued elements list fulfilling condition listed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"assert_list_element( list, element, condition, message_text, arg_name = rlang::caller_arg(list), message = NULL, class = \"assert_list_element\", call = parent.frame(), ... )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"list list checked list named lists classes expected. element name element lists/classes character scalar expected. condition Condition fulfilled condition evaluated element list. element lists/classes can referred name, e.g., censor == 0 check censor field class. message_text Text displayed error message listing values meet condition. text describe condition fulfilled, e.g., \"Error {arg_name}: censor values must zero.\". message argument specified, text displayed message_text ignored. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages. ... Objects required evaluate condition message text condition message text contains objects apart element, passed function. See second example .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"error condition met. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"death <- list( dataset_name = \"adsl\", date = \"DTHDT\", censor = 0 ) lstalv <- list( dataset_name = \"adsl\", date = \"LSTALVDT\", censor = 1 ) events <- list(death, lstalv) try(assert_list_element( list = events, element = \"censor\", condition = censor == 0, message_text = \"For events the censor values must be zero.\" )) #> Error in eval(expr, envir) : #> For events the censor values must be zero. #> ℹ But, `events[[2]]$censor = 1` try(assert_list_element( list = events, element = \"dataset_name\", condition = dataset_name %in% c(\"adrs\", \"adae\"), valid_datasets = c(\"adrs\", \"adae\"), message_text = paste( \"The dataset name must be one of the following: {.val {valid_datasets}}\" ) )) #> Error in eval(expr, envir) : #> The dataset name must be one of the following: \"adrs\" and \"adae\" #> ℹ But, `events[[1]]$dataset_name = adsl`, and `events[[2]]$dataset_name = adsl`"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"Checks argument list objects inheriting S3 class type specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"assert_list_of( arg, cls, named = FALSE, optional = TRUE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_list_of\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"arg function argument checked cls S3 class type check named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"function throws error arg list arg list elements objects inheriting class type class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"example_fun <- function(list) { assert_list_of(list, \"data.frame\") } example_fun(list(mtcars, iris)) try(example_fun(list(letters, 1:10))) #> Error in example_fun(list(letters, 1:10)) : #> Each element of the list in argument `list` must be class/type #> . #> ℹ But, element 1 is a character vector, and element 2 is an integer vector try(example_fun(c(TRUE, FALSE))) #> Error in example_fun(c(TRUE, FALSE)) : #> Argument `list` must be class , but is a logical vector. example_fun2 <- function(list) { assert_list_of(list, \"numeric\", named = TRUE) } try(example_fun2(list(1, 2, 3, d = 4))) #> Error in example_fun2(list(1, 2, 3, d = 4)) : #> All elements of `list` argument must be named. #> ℹ The indices of the unnamed elements are 1, 2, and 3"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"Checks argument logical scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"assert_logical_scalar( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_logical_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown. Otherwise, NULL considered valid value. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"function throws error arg neither TRUE FALSE. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"example_fun <- function(flag) { assert_logical_scalar(flag) } example_fun(FALSE) try(example_fun(NA)) #> Error in example_fun(NA) : #> Argument `flag` must be either TRUE or FALSE, but is `NA`. try(example_fun(c(TRUE, FALSE, FALSE))) #> Error in example_fun(c(TRUE, FALSE, FALSE)) : #> Argument `flag` must be either TRUE or FALSE, but is a logical vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `flag` must be either TRUE or FALSE, but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is a Named List or Vector — assert_named","title":"Assert Argument is a Named List or Vector — assert_named","text":"Assert elements argument named.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"assert_named( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_named\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is a Named List or Vector — assert_named","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is a Named List or Vector — assert_named","text":"function throws error arg named list vector returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"example_fun <- function(varval_list) { assert_named(varval_list) } example_fun(list(var1 = 1, var2 = \"x\")) try(example_fun(list(1, \"x\"))) #> Error in example_fun(list(1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 1 and 2 try(example_fun(list(var = 1, \"x\"))) #> Error in example_fun(list(var = 1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Numeric Vector? — assert_numeric_vector","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"Checks argument numeric vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"assert_numeric_vector( arg, length = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_numeric_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"arg function argument checked length Expected length argument specified set NULL, length accepted. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"function throws error arg numeric vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"example_fun <- function(num) { assert_numeric_vector(num) } example_fun(1:10) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `num` must be a numeric vector, but it is a character vector. example_fun <- function(num) { assert_numeric_vector(num, length = 2) } try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `num` must be a vector of length 2, but has length 10."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":null,"dir":"Reference","previous_headings":"","what":"Is There a One to One Mapping between Variables? — assert_one_to_one","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"Checks one one mapping two lists variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"assert_one_to_one( dataset, vars1, vars2, dataset_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_one_to_one\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"dataset Dataset checked variables specified vars1 vars2 expected. vars1 First list variables vars2 Second list variables dataset_name string indicating label/symbol object checked. Default rlang::caller_arg(dataset). message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"dataset_name\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"error condition meet. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"library(dplyr) library(rlang) df <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 1L ) assert_one_to_one(df, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) df_many <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 3L ) try( assert_one_to_one(df_many, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) ) #> Error in eval(expr, envir) : #> For some values of \"SPECIES\" there is more than one value of \"SPECIESN\" #> ℹ Call `admiral::get_one_to_many_dataset()` to get all one-to-many values. try( assert_one_to_one(df_many, vars1 = exprs(SPECIESN), vars2 = exprs(SPECIES)) ) #> Error in eval(expr, envir) : #> There is more than one value of \"SPECIESN\" for some values of \"SPECIES\" #> ℹ Call `admiral::get_many_to_one_dataset()` to get all many-to-one values."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"Checks parameter (PARAMCD) exist dataset.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"assert_param_does_not_exist( dataset, param, arg_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_param_does_not_exist\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"dataset data.frame param Parameter code check arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"function throws error parameter exists input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_param_does_not_exist(advs, param = \"HR\") try(assert_param_does_not_exist(advs, param = \"WEIGHT\")) #> Error in eval(expr, envir) : #> The parameter code \"WEIGHT\" already exists in dataset `advs`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"Checks argument object inheriting S3 class specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"assert_s3_class( arg, cls, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_s3_class\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"arg function argument checked cls S3 class check optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"function throws error arg object inherit class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"example_fun <- function(obj) { assert_s3_class(obj, \"factor\") } example_fun(as.factor(letters)) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `obj` must be class , but is a character vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `obj` must be class , but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Are All Argument of the Same Type? — assert_same_type","title":"Are All Argument of the Same Type? — assert_same_type","text":"Checks arguments type.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"assert_same_type( ..., .message = c(\"Arguments {.arg {arg_names}} must be the same type.\", i = paste(\"Argument types are\", paste0(\"{.arg \", arg_names, \"} {.cls \", types, \"}\", collapse = \", \"))), .class = \"assert_same_type\", .call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Are All Argument of the Same Type? — assert_same_type","text":"... Arguments checked .message character vector passed cli_abort(message) assertion fails. .class character vector passed cli_abort(class) assertion fails. .call environment passed cli_abort(call) assertion fails.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Are All Argument of the Same Type? — assert_same_type","text":"function throws error arguments type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"example_fun <- function(true_value, false_value, missing_value) { assert_same_type(true_value, false_value, missing_value) } example_fun( true_value = \"Y\", false_value = \"N\", missing_value = NA_character_ ) try(example_fun( true_value = 1, false_value = 0, missing_value = \"missing\" )) #> Error in example_fun(true_value = 1, false_value = 0, missing_value = \"missing\") : #> Arguments `true_value`, `false_value`, and `missing_value` must be the #> same type. #> ℹ Argument types are `true_value` , `false_value` , #> `missing_value` "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Symbol? — assert_symbol","title":"Is an Argument a Symbol? — assert_symbol","text":"Checks argument symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"assert_symbol( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_symbol\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Symbol? — assert_symbol","text":"arg function argument checked. Must symbol. See examples. optional checked argument optional? set FALSE arg NULL error thrown. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Symbol? — assert_symbol","text":"function throws error arg symbol returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~USUBJID, \"DM\", \"01-701-1015\", \"DM\", \"01-701-1016\", ) example_fun <- function(dat, var) { var <- assert_symbol(enexpr(var)) select(dat, !!var) } example_fun(dm, USUBJID) #> # A tibble: 2 × 1 #> USUBJID #> #> 1 01-701-1015 #> 2 01-701-1016 try(example_fun(dm)) #> Error in example_fun(dm) : #> Argument `var` must be a , but is missing. try(example_fun(dm, \"USUBJID\")) #> Error in example_fun(dm, \"USUBJID\") : #> Argument `var` must be a , but is a string. try(example_fun(dm, toupper(PARAMCD))) #> Error in example_fun(dm, toupper(PARAMCD)) : #> Argument `var` must be a , but is a call."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"Checks parameter (PARAMCD) dataset provided expected unit.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"assert_unit( dataset, param, required_unit = NULL, get_unit_expr, arg_name = rlang::caller_arg(required_unit), message = NULL, class = \"assert_unit\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"dataset Dataset checked variable PARAMCD used get_unit_expr expected. param Parameter code parameter check required_unit Expected unit(s) argument set NULL, checked whether unit unique within parameter. Permitted Values: character vector NULL get_unit_expr Expression used provide unit param arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"function throws error one non-missing unit dataset unit variable differs expected unit observation parameter input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_unit(advs, param = \"WEIGHT\", required_unit = \"kg\", get_unit_expr = VSSTRESU) try( assert_unit( advs, param = \"WEIGHT\", required_unit = c(\"g\", \"mg\"), get_unit_expr = VSSTRESU ) ) #> Error in eval(expr, envir) : #> It is expected that \"WEIGHT\" has unit of \"g\" or \"mg\". In the input #> dataset the unit is \"kg\". # Checking uniqueness of unit only advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85700, \"g\", \"WEIGHT\", 85700 ) try( assert_unit(advs, param = \"WEIGHT\", get_unit_expr = VSSTRESU) ) #> Error in eval(expr, envir) : #> Multiple units \"kg\" and \"g\" found for \"WEIGHT\". Please review and update #> the units."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Variables? — assert_vars","title":"Is an Argument a List of Variables? — assert_vars","text":"Checks argument valid list symbols (e.g., created exprs())","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"assert_vars( arg, expect_names = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_vars\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Variables? — assert_vars","text":"arg function argument checked expect_names argument set TRUE, checked variables named, e.g., exprs(APERSDT = APxxSDT, APEREDT = APxxEDT). optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Variables? — assert_vars","text":"function throws error arg list symbols (e.g., created exprs() returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(by_vars) { assert_vars(by_vars) } example_fun(exprs(USUBJID, PARAMCD)) try(example_fun(quos(USUBJID, PARAMCD))) #> Error in example_fun(quos(USUBJID, PARAMCD)) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 1 is a object, and element 2 is a object try(example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\"))) #> Error in example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\")) : #> Argument `by_vars` must be class , but is a character vector. try(example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL)))) #> Error in example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL))) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 2 is a call, and element 3 is a call example_fun_name <- function(by_vars) { assert_vars(by_vars, expect_names = TRUE) } example_fun_name(exprs(APERSDT = APxxSDT, APEREDT = APxxEDT)) try(example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT))) #> Error in example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT)) : #> All elements of `by_vars` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Variable-Value List? — assert_varval_list","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"Checks argument list expressions expressions variable-value pairs. value can symbol, string, numeric, expression, NA.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"assert_varval_list( arg, required_elements = NULL, accept_expr = TRUE, accept_var = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_varval_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"arg function argument checked required_elements character vector names must present arg accept_expr expressions right hand side accepted? accept_var unnamed variable names (e.g. exprs(USUBJID)) right hand side accepted? optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"function throws error arg list variable-value expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(vars) { assert_varval_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ)) : #> Argument `vars` must be a named list of expressions where each element #> is a symbol, character scalar, numeric scalar, an expression, or NA, but is a #> list. #> ℹ To create a list of expressions use `exprs()`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Backquotes — backquote","title":"Wrap a String in Backquotes — backquote","text":"Wrap String Backquotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Backquotes — backquote","text":"","code":"backquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Backquotes — backquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Backquotes — backquote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"check argument contains valid variable(s) created exprs() Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"","code":"contains_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"arg function argument checked","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"TRUE variables valid variable","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"Helper Function Convert Date (Date-time) Objects Characters dtc Format (-DTC type variable)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"","code":"convert_dtm_to_dtc(dtm)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"dtm date date-time","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":null,"dir":"Reference","previous_headings":"","what":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"Output dataset vignette pre-specified admiral format.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"","code":"dataset_vignette(dataset, display_vars = NULL, filter = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"dataset Dataset output vignette display_vars Variables selected demonstrate outcome derivation Permitted Values: list variables Default NULL display_vars NULL, selected variables visible vignette variables hidden. can made visible clicking theChoose columns display button. filter Filter condition specified condition applied dataset displayed. Permitted Values: condition","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"HTML table","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecation with Soft Message — deprecate_inform","title":"Deprecation with Soft Message — deprecate_inform","text":"Wrapper around lifecycle::deprecate_soft() messages users deprecated features functions instead warning.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"deprecate_inform( when, what, with = NULL, details = NULL, id = NULL, env = rlang::caller_env(), user_env = rlang::caller_env(2) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecation with Soft Message — deprecate_inform","text":"string giving version behaviour deprecated. string describing deprecated: Deprecate whole function \"foo()\". Deprecate argument \"foo(arg)\". Partially deprecate argument \"foo(arg = 'must scalar integer')\". Deprecate anything else custom message wrapping (). can optionally supply namespace: \"ns::foo()\", usually needed inferred caller environment. optional string giving recommended replacement deprecated behaviour. takes form . details cases deprecation message can automatically generated . , use details provide hand-written message. details can either single string character vector, converted bulleted list. default, info bullets used. Provide named vectors override. id id deprecation. warning issued id. Defaults generated message, give unique ID message details built programmatically depends inputs, like deprecate multiple functions warn . env, user_env Pair environments define deprecate_*() called (used determine package name) function called deprecating function called (used determine deprecate_soft() message). needed calling deprecate_*() internal helper, case forward env = caller_env() user_env = caller_env(2).","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecation with Soft Message — deprecate_inform","text":"NULL, invisibly.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"# A Phase 1 deprecated function with custom bulleted list: deprecate_inform( when = \"1.0.0\", what = \"foo()\", details = c( x = \"This message will turn into a warning with release of x.y.z\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Double Quotes — dquote","title":"Wrap a String in Double Quotes — dquote","text":"Wrap string double quotes, e.g., displaying character values messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Double Quotes — dquote","text":"","code":"dquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Double Quotes — dquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Double Quotes — dquote","text":"input NULL, text \"NULL\" returned. Otherwise, input double quotes returned.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate Multiple Elements — enumerate","title":"Enumerate Multiple Elements — enumerate","text":"Enumerate multiple elements vector list.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(x, quote_fun = backquote, conjunction = \"and\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate Multiple Elements — enumerate","text":"x vector list quote_fun Quoting function, defaults backquote. set NULL, elements quoted. conjunction Character used message, defaults \"\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate Multiple Elements — enumerate","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(c(\"one\", \"two\", \"three\")) #> Warning: `enumerate()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.val {letters[1:3]}}')` #> [1] \"`one`, `two` and `three`\" enumerate(c(1, 2, 3), quote_fun = NULL) #> [1] \"1, 2 and 3\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"Uses diffdf::diffdf() compares 2 datasets differences. function can thought R-equivalent SAS proc compare useful tool unit testing well.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"expect_dfs_equal(base, compare, keys, ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"base Input dataset compare Comparison dataset keys character vector variables define unique row base compare datasets ... Additional arguments passed onto diffdf::diffdf()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"error base compare match NULL invisibly ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"library(dplyr, warn.conflicts = FALSE) tbl1 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 19, \"F\", \"1003\", 20, \"M\", \"1004\", 18, \"F\" ) tbl2 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 18.9, \"F\", \"1003\", 20, NA ) try(expect_dfs_equal(tbl1, tbl2, keys = \"USUBJID\")) #> Error : Differences found between the objects! #> #> Summary of BASE and COMPARE #> ================================================================== #> PROPERTY BASE COMP #> ------------------------------------------------------------------ #> Name base compare #> Class \"tbl_df, tbl, data.frame\" \"tbl_df, tbl, data.frame\" #> Rows(#) 4 3 #> Columns(#) 3 3 #> ------------------------------------------------------------------ #> #> #> There are rows in BASE that are not in COMPARE !! #> ========= #> USUBJID #> --------- #> 1004 #> --------- #> #> #> Not all Values Compared Equal #> ============================= #> Variable No of Differences #> ----------------------------- #> AGE 1 #> SEX 1 #> ----------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> AGE 1002 19 18.9 #> ---------------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> SEX 1003 M #> ---------------------------------- #> #> tlb3 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1004\", 18, \"F\", \"1003\", 20, \"M\", \"1002\", 19, \"F\", \"1001\", 18, \"M\", ) # Note the sorting order of the keys is not required expect_dfs_equal(tbl1, tlb3, keys = \"USUBJID\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":null,"dir":"Reference","previous_headings":"","what":"Concatenate One or More Expressions — expr_c","title":"Concatenate One or More Expressions — expr_c","text":"Concatenate One Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concatenate One or More Expressions — expr_c","text":"","code":"expr_c(...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concatenate One or More Expressions — expr_c","text":"... One expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concatenate One or More Expressions — expr_c","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract All Symbols from a List of Expressions — extract_vars","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"Extract Symbols List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"extract_vars(x, side = \"lhs\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"x R object side One \"lhs\" (default) \"rhs\" formulas","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"library(rlang) extract_vars(exprs(PARAMCD, (BASE - AVAL) / BASE + 100)) #> [[1]] #> PARAMCD #> #> [[2]] #> BASE #> #> [[3]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1) #> [[1]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1, side = \"rhs\") #> [[1]] #> ARMCD #> #> [[2]] #> AGEGR1 #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Optional Filter — filter_if","title":"Optional Filter — filter_if","text":"Filters input dataset provided expression NULL","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optional Filter — filter_if","text":"","code":"filter_if(dataset, filter)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Optional Filter — filter_if","text":"dataset Input dataset filter filter condition. Must expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Optional Filter — filter_if","text":"data.frame containing rows dataset matching filter just dataset filter NULL","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Return English-friendly messaging for object-types — friendly_type_of","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"Return English-friendly messaging object-types","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"","code":"friendly_type_of(x, value = TRUE, length = FALSE)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"x R object. value Whether describe value x. length Whether mention length vectors lists.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"string describing type. Starts indefinite article, e.g. \"integer vector\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"helper function aids us forming user-friendly messages gets called what_is_it(), often used assertion functions identify object-type user passed argument instead expected-type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Constant Variables — get_constant_vars","title":"Get Constant Variables — get_constant_vars","text":"Get Constant Variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Constant Variables — get_constant_vars","text":"","code":"get_constant_vars(dataset, by_vars, ignore_vars = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Constant Variables — get_constant_vars","text":"dataset data frame. by_vars variables groups defined variables considered separately. .e., variable constant within group, returned. ignore_vars Variables ignore specified variables considered, .e., returned even constant (unless included variables). Permitted Values: list variable names selector function calls like starts_with(\"EX\")","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Constant Variables — get_constant_vars","text":"Variable vector.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Retrieve Dataset admiraldev_environment environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"","code":"get_dataset(name)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"name name dataset retrieve","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Sometimes, developers may want provide information users fit warning error message. example, input dataset function contains unexpected records, can stored separate dataset, users can access investigate issue. achieve , R data structure known 'environment'. environment objects created build time, can populated values package loaded update values course R session. , establishment admiraldev_environment allows us create dynamic data/objects based user-inputs need modification. purpose get_dataset retrieve datasets contained inside admiraldev_environment. Currently support two datasets inside admiraldev_environment object: one_to_many many_to_one","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Duplicates From a Vector — get_duplicates","title":"Get Duplicates From a Vector — get_duplicates","text":"Get Duplicates Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Duplicates From a Vector — get_duplicates","text":"x atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Duplicates From a Vector — get_duplicates","text":"vector type x contain duplicate values","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(1:10) #> integer(0) get_duplicates(c(\"a\", \"a\", \"b\", \"c\", \"d\", \"d\")) #> [1] \"a\" \"d\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"Get New Temporary Variable Name Dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"get_new_tmp_var(dataset, prefix = \"tmp_var\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"dataset input dataset prefix prefix new temporary variable name create","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"name new temporary variable symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"function returns new unique temporary variable name used inside dataset. temporary variable names structure prefix_n n integer, e.g. tmp_var_1. already variable inside datset given prefix suffix increased 1, e.g. tmp_var_1 already exists get_new_tmp_var() return tmp_var_2.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) tmp_var <- get_new_tmp_var(dm) mutate(dm, !!tmp_var := NA) #> # A tibble: 2 × 4 #> DOMAIN STUDYID USUBJID tmp_var_1 #> #> 1 DM STUDY X 01-701-1015 NA #> 2 DM STUDY X 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Source Variables from a List of Expressions — get_source_vars","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"Get Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"","code":"get_source_vars(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":null,"dir":"Reference","previous_headings":"","what":"Negated Value Matching — %notin%","title":"Negated Value Matching — %notin%","text":"Returns logical vector indicating match left operand right operand.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Negated Value Matching — %notin%","text":"","code":"x %notin% table"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Negated Value Matching — %notin%","text":"x values matched table values matched ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Negated Value Matching — %notin%","text":"logical vector","code":""},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Or — %or%","text":"","code":"lhs %or% rhs"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Or — %or%","text":"lhs valid R expression rhs valid R expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Or — %or%","text":"Either result evaluating lhs, rhs error","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Or — %or%","text":"function evaluates expression lhs expression results error, catches error proceeds evaluating expression rhs returns result.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks if the argument equals the auto keyword — is_auto","title":"Checks if the argument equals the auto keyword — is_auto","text":"Checks argument equals auto keyword","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks if the argument equals the auto keyword — is_auto","text":"","code":"is_auto(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks if the argument equals the auto keyword — is_auto","text":"arg argument check","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Checks if the argument equals the auto keyword — is_auto","text":"TRUE argument equals auto keyword, .e., expression symbol named auto.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is order vars? — is_order_vars","title":"Is order vars? — is_order_vars","text":"Check inputs created using exprs() calls involving desc()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is order vars? — is_order_vars","text":"","code":"is_order_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is order vars? — is_order_vars","text":"arg R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is order vars? — is_order_vars","text":"FALSE argument list order vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Is this string a valid DTC — is_valid_dtc","title":"Is this string a valid DTC — is_valid_dtc","text":"string valid DTC","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is this string a valid DTC — is_valid_dtc","text":"","code":"is_valid_dtc(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is this string a valid DTC — is_valid_dtc","text":"arg character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is this string a valid DTC — is_valid_dtc","text":"TRUE argument valid --DTC string, FALSE otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":null,"dir":"Reference","previous_headings":"","what":"Join Functions — anti_join","title":"Join Functions — anti_join","text":"*_join() functions {dplyr} without warning different attributes datasets.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Join Functions — anti_join","text":"","code":"anti_join(x, y, by = NULL, copy = FALSE, ...) inner_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...) left_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Join Functions — anti_join","text":"x data.frame y data.frame character vector copy logical ... Additional arguments suffix character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Join Functions — anti_join","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Process set_values_to Argument — process_set_values_to","title":"Process set_values_to Argument — process_set_values_to","text":"function creates variables specified set_values_to argument, catches errors, provides user friendly error messages, optionally checks type created variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"process_set_values_to(dataset, set_values_to = NULL, expected_types = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process set_values_to Argument — process_set_values_to","text":"dataset Input dataset set_values_to Variables set named list returned exprs() defining variables set, e.g. exprs(PARAMCD = \"OS\", PARAM = \"Overall Survival\") expected. values must symbols, character strings, numeric values, expressions, NA. expected_types argument specified, specified variables checked whether specified type matches type variables created set_values_to. Permitted Values: character vector values \"numeric\" \"character\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process set_values_to Argument — process_set_values_to","text":"input dataset variables specified set_values_to added/updated","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"library(dplyr) data <- tribble( ~AVAL, 20 ) try( process_set_values_to( data, set_values_to = exprs( PARAMCD = BMI ) ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = BMI)) : #> Assigning variables failed! #> • `set_values_to = exprs(PARAMCD = BMI)` #> See error message below: #> ℹ In argument: `PARAMCD = BMI`. Caused by error: ! object 'BMI' not found try( process_set_values_to( data, set_values_to = exprs( PARAMCD = 42 ), expected_types = c(PARAMCD = \"character\") ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = 42), : #> The following variables have an unexpected type: #> • PARAMCD: expected is , but it is ."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"Remove Temporary Variables Created Within Current Function Environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"remove_tmp_vars(dataset)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"dataset input dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"input dataset temporary variables removed","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) dm <- select(dm, USUBJID) tmp_var <- get_new_tmp_var(dm) dm <- mutate(dm, !!tmp_var := NA) ## This function creates two new temporary variables which are removed when calling ## `remove_tmp_vars()`. Note that any temporary variable created outside this ## function is **not** removed do_something <- function(dataset) { tmp_var_1 <- get_new_tmp_var(dm) tmp_var_2 <- get_new_tmp_var(dm) dm %>% mutate(!!tmp_var_1 := NA, !!tmp_var_2 := NA) %>% print() %>% remove_tmp_vars() } do_something(dm) #> # A tibble: 2 × 4 #> USUBJID tmp_var_1 tmp_var_2 tmp_var_3 #> #> 1 01-701-1015 NA NA NA #> 2 01-701-1016 NA NA NA #> # A tibble: 2 × 2 #> USUBJID tmp_var_1 #> #> 1 01-701-1015 NA #> 2 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Symbols in an Expression — replace_symbol_in_expr","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Replace symbols expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"replace_symbol_in_expr(expression, target, replace)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression Expression target Target symbol replace Replacing symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression every occurrence symbol target replaced replace","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Stefan Bundfuss","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"library(rlang) replace_symbol_in_expr(expr(AVAL), target = AVAL, replace = AVAL.join) #> AVAL.join replace_symbol_in_expr(expr(AVALC), target = AVAL, replace = AVAL.join) #> AVALC replace_symbol_in_expr(expr(desc(AVAL)), target = AVAL, replace = AVAL.join) #> desc(AVAL.join)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Expression Value with Name — replace_values_by_names","title":"Replace Expression Value with Name — replace_values_by_names","text":"Replace Expression Value Name","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"replace_values_by_names(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Expression Value with Name — replace_values_by_names","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Expression Value with Name — replace_values_by_names","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"library(rlang) replace_values_by_names(exprs(AVAL, ADT = convert_dtc_to_dt(EXSTDTC))) #> [[1]] #> AVAL #> #> $ADT #> ADT #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Single Quotes — squote","title":"Wrap a String in Single Quotes — squote","text":"Wrap String Single Quotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Single Quotes — squote","text":"","code":"squote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Single Quotes — squote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Single Quotes — squote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":null,"dir":"Reference","previous_headings":"","what":"Suppress Specific Warnings — suppress_warning","title":"Suppress Specific Warnings — suppress_warning","text":"Suppress certain warnings issued expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Suppress Specific Warnings — suppress_warning","text":"","code":"suppress_warning(expr, regexpr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Suppress Specific Warnings — suppress_warning","text":"expr Expression executed regexpr Regular expression matching warnings suppress","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Suppress Specific Warnings — suppress_warning","text":"Return value expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Suppress Specific Warnings — suppress_warning","text":"warnings issued expression match regular expression suppressed.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":null,"dir":"Reference","previous_headings":"","what":"Valid Time Units — valid_time_units","title":"Valid Time Units — valid_time_units","text":"Contains acceptable character vector valid time units","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Valid Time Units — valid_time_units","text":"","code":"valid_time_units()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Valid Time Units — valid_time_units","text":"character vector valid time units","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn a List of Expressions into a Character Vector — vars2chr","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"Turn List Expressions Character Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"vars2chr(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"expressions list expressions created using exprs()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) vars2chr(exprs(USUBJID, AVAL)) #> #> \"USUBJID\" \"AVAL\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn if incomplete dtc — warn_if_incomplete_dtc","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"Warn incomplete dtc","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"","code":"warn_if_incomplete_dtc(dtc, n)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"dtc character vector date-times ISO 8601 format n non-negative integer","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"warning dtc contains partial dates","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"Checks two list inputs names number elements issues warning otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"warn_if_inconsistent_list(base, compare, list_name, i = 2)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"base named list compare named list list_name string name list index id compare 2 lists","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"warning 2 lists different names length","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) # no warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) # warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ, DTHVAR = \"text\"), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) #> Warning: The variables used for traceability in `Test` are not consistent, please check: #> source 1 , Variables are given as: DTHDOM DTHSEQ DTHVAR #> source 2 , Variables are given as: DTHDOM DTHSEQ"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"Warn vector contains unknown datetime format \"2003-12-15T-:15:18\", \"2003-12-15T13:-:19\",\"–12-15\",\"—–T07:15\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"warn_if_invalid_dtc(dtc, is_valid = is_valid_dtc(dtc))"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"dtc character vector containing dates is_valid logical vector indicating whether elements dtc valid","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"## No warning as `dtc` is a valid date format warn_if_invalid_dtc(dtc = \"2021-04-06\") ## Issues a warning warn_if_invalid_dtc(dtc = \"2021-04-06T-:30:30\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Variable Already Exists — warn_if_vars_exist","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"Warn variable already exists inside dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"warn_if_vars_exist(dataset, vars)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"dataset data.frame vars character vector columns check dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~USUBJID, ~ARM, \"01-701-1015\", \"Placebo\", \"01-701-1016\", \"Placebo\", ) ## No warning as `AAGE` doesn't exist in `dm` warn_if_vars_exist(dm, \"AAGE\") ## Issues a warning warn_if_vars_exist(dm, \"ARM\") #> Warning: Variable \"ARM\" already exists in the dataset."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":null,"dir":"Reference","previous_headings":"","what":"What Kind of Object is This? — what_is_it","title":"What Kind of Object is This? — what_is_it","text":"Returns string describing kind object input .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"What Kind of Object is This? — what_is_it","text":"x R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"What Kind of Object is This? — what_is_it","text":"character description type x","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(\"abc\") #> Warning: `what_is_it()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.obj_type_friendly {letters}}')`. #> [1] \"`\\\"abc\\\"`\" what_is_it(1L) #> [1] \"`1`\" what_is_it(1:10) #> [1] \"an integer vector\" what_is_it(mtcars) #> [1] \"a data frame\""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-development-version","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev (development version)","text":"New Function deprecate_inform() wrapper around lifecycle::deprecate_soft() allow control messaging. (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-development-version","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev (development version)","text":"Objects passed assert_list_element() via ... argument can now used glue expression specified message_text argument. (#469) required_unit argument assert_unit() enhanced. now possible specify one unit specify . latter case uniqueness unit checked. (#468) assert_numeric_vector() function gained optional length argument check whether vector specific length. (#473)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-development-version","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev (development version)","text":"admiraldev compatible R version >=4.1 (#456) following function arguments entering next phase deprecation process: (#459) Phase 1 (message) functions arguments Phase Phase 2 (warning) functions arguments Phase Phase 3 (error) functions arguments Phase Phase 4 (removed) argument quosures removed functions vars2chr(quosures), replace_values_by_names(quosures), get_source_vars(quosures) Removed v1.0.0 assert_named_expr() Removed v1.0.0 assert_has_variables() Removed v1.0.0 assert_function_param()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-development-version","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev (development version)","text":"Deprecation Strategy updated long haul! (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-development-version","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev (development version)","text":"devcontainer files removed (#480)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-110","dir":"Changelog","previous_headings":"","what":"admiraldev 1.1.0","title":"admiraldev 1.1.0","text":"CRAN release: 2024-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.1.0","text":"Updated arg_name parameter assert_filter_cond, assert_symbol, assert_expr gsub(\"^enexpr\\\\((\\\\w+)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)) argument error messages return quoted argument without enexpr(), e.g. filter_add instead enexpr(filter_add). (#2404) Error messaging throughout package updated rlang::abort() cli::cli_abort(). part update, assert_*() functions new arguments assert_*(message, arg_name, call, class). (#367) Warning messaging also updated use cli messaging.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.1.0","text":"renv related files removed. (#360) longer exporting is_named() function. (#401) pharmaversesdtm removed dependency. (#434) part error messaging update, following changes made. assert_s3_class(class) argument renamed assert_s3_class(cls). (#367) Functions arg_name(), enumerate(), what_is_it(), friendly_type_of() deprecated warning returned developer using functions. developer functions (opposed functions typical admiral users), use short deprecation cycle.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.1.0","text":"“Release Strategy” vignette updated respect new branching strategy. (#353) “Release Strategy” vignette now contains short new “Release Tracking” section linking external dashboard CRAN packages awaiting release. (#358)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-1-1-0","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev 1.1.0","text":"Removed dependencies needed build package package documentation. (#426) Increased minimum R version required 4.0 match {admiral}. (#382) addin_format_testthat addin moved {pharmaverse4devs} package. (#419)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-100","dir":"Changelog","previous_headings":"","what":"admiraldev 1.0.0","title":"admiraldev 1.0.0","text":"CRAN release: 2023-12-15","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-0-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.0.0","text":"assert_function() now accepts function arguments ellipsis, ... function formals (#339)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.0.0","text":"assert_function_param() assert_named_expr() assert_has_variables()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-0-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.0.0","text":"New documentation programming strategy around quoting/expressions standardizing roxygen texts (#233, #332) New documentation use footnotes writing vignettes (#324) Updated language images adopt GitHub Flow Strategy (#349)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-050","dir":"Changelog","previous_headings":"","what":"admiraldev 0.5.0","title":"admiraldev 0.5.0","text":"CRAN release: 2023-09-11","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-5-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.5.0","text":"Calls admiral.test swapped pharmaversesdtm (#321) New vignette package writing extensions now available (#295, #312) New vignette creating test data now available (#282)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-5-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.5.0","text":"messaging warn_if_invalid_dtc() updated align date/datetime functions admiral currently . (#316)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.5.0","text":"assert_order_vars() quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names(), get_source_vars(), vars2chr(). (#288) assert_function_param() deprecated favor assert_function(). (#264) assert_named_expr() deprecated favor assert_expr_list(). (#264) assert_has_variables() deprecated favor assert_data_frame(). (#264)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-5-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.5.0","text":"Guidance around issues merging updated (#286) Common R CMD troubleshooting made separate vignette (#286) Documentation get_dataset() improved. (#271) Minor updates programming strategy added (#213, #240, #260) Updated unit testing vignette snapshot testing guidance. (#302) Documentation friendly_type_of() provided (#22) Minor updates pull request review guidance added (#201, #292) Documentation singular versus plural function argument names added programming strategy vignette. Also documentation common arguments missing_value missing_values added. (#296) Documentation highlighting difference set_values_to keep_source_vars (#318) List common arguments updated (#306)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-040","dir":"Changelog","previous_headings":"","what":"admiraldev 0.4.0","title":"admiraldev 0.4.0","text":"CRAN release: 2023-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-4-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.4.0","text":"New function assert_named() check elements argument named (#241) New function assert_expr_list() check argument list expressions (#241) Added Report bug link admiraldev website (#257)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.4.0","text":"assert_order_vars() deprecated favor assert_expr_list(). (#241) following functions deprecated previous admiral versions using next phase deprecation process: (#272) quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names().","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-4-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.4.0","text":"deprecation strategy updated regarding unit tests deprecated functions/arguments phase 1. (#247) programming strategy updated regarding permitted values calling functions package dependencies (#72, #253)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-030","dir":"Changelog","previous_headings":"","what":"admiraldev 0.3.0","title":"admiraldev 0.3.0","text":"CRAN release: 2023-03-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-3-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.3.0","text":"New function process_set_values_to() creating variables specified set_value_to argument catching errors (#70)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-3-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.3.0","text":"Using testthat3e (testthat 3rd edition) unit testing. stricter messages must addressed deprecated functions throw errors. (#230) Slight boost test coverage dev_utilities (#102) Fix datatable styling documentation (#197) assert_character_vector() function gained named argument check elements vector named. (#70) assert_list_of() function gained named argument check elements list named. (#203) quote_fun argument enumerate() extended NULL can specified request quoting elements. (#203) assert_list_of() function enhanced also considers type element, e.g., check value list symbols. (#208)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.3.0","text":"default value optional argument assert_date_vector(), assert_list_of(), assert_s3_class() changed TRUE FALSE make default behavior consistent. (#87) quo_c() replace_symbol_in_quo() quosures argument get_source_vars(), replace_values_by_names(), vars2chr()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-3-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.3.0","text":"New section programming strategy regarding comments (#71) Removed requirement add @author tags code scripts programming strategy, tracking authors DESCRIPTION file. Authors removed function documentation line update. (#206, #210) Removed -boarding Issue Template (#225) Increased clarity scope package (#232)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-020","dir":"Changelog","previous_headings":"","what":"admiraldev 0.2.0","title":"admiraldev 0.2.0","text":"CRAN release: 2022-11-30","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.2.0","text":"Developer addin formatting tests admiral programming standards (#73) New functions replace_symbol_in_quo() add_suffix_to_vars() (#106) New function assert_atomic_vector() (#98) New keyword/family create_aux functions creating auxiliary datasets (#126) New function assert_date_vector() (#129) New function assert_same_type() (#176) Remove dependency {assertthat} (#149) Test coverage admiraldev increased 45% approximately 100% (#94, #95, #96, #98, #101, #103) Environment objects consolidated single admiraldev_environment object R/admiraldev_environment.R. (#179)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.2.0","text":"expect_names argument added assert_vars() check variables named (#117) Remove dplyr function exports migration user facing function negate_vars() admiral (#83)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.2.0","text":"longer compatible admiral (<0.9)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.2.0","text":"New vignette package release strategy (#79) Updated multiple roxygen headers (#116, #133, #134, #141, #145, #172) Description admiral options work certain function inputs, .e subject_keys (#133)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-2-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.2.0","text":"PR Checklist Template updated (#172) New authors/contributors (#158)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-010","dir":"Changelog","previous_headings":"","what":"admiraldev 0.1.0","title":"admiraldev 0.1.0","text":"CRAN release: 2022-08-26","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-1-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.1.0","text":"Developer specific functions brought admiral Developer specific vignettes brought admiral New admiraldev website created","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-1-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.1.0","text":"NA","code":""}] +[{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Version 2.0, January 2004 ","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_1-definitions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"1. Definitions","title":"Apache License","text":"“License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_2-grant-of-copyright-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"2. Grant of Copyright License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_3-grant-of-patent-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"3. Grant of Patent License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_4-redistribution","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"4. Redistribution","title":"Apache License","text":"may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: () must give recipients Work Derivative Works copy License; (b) must cause modified files carry prominent notices stating changed files; (c) must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; (d) Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_5-submission-of-contributions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"5. Submission of Contributions","title":"Apache License","text":"Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_6-trademarks","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"6. Trademarks","title":"Apache License","text":"License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_7-disclaimer-of-warranty","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"7. Disclaimer of Warranty","title":"Apache License","text":"Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_8-limitation-of-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"8. Limitation of Liability","title":"Apache License","text":"event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"id_9-accepting-warranty-or-additional-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"9. Accepting Warranty or Additional Liability","title":"Apache License","text":"redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/LICENSE.html","id":"appendix-how-to-apply-the-apache-license-to-your-work","dir":"","previous_headings":"","what":"APPENDIX: How to apply the Apache License to your work","title":"Apache License","text":"apply Apache License work, attach following boilerplate notice, fields enclosed brackets [] replaced identifying information. (Don’t include brackets!) text enclosed appropriate comment syntax file format. also recommend file class name description purpose included “printed page” copyright notice easier identification within third-party archives.","code":"Copyright 2021 F. Hoffmann-La Roche AG and GlaxoSmithKline LLC Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"dear-developers","dir":"Articles","previous_headings":"","what":"Dear Developers","title":"Get Started","text":"admiraldev set tools intended , developer, help make developing within admiral family easier, consistently robust across packages maybe even fun! Tools loosely defined follows: Utility Functions used admiral admiral extension functions custom checks providing custom messages, warnings errors. custom messages, warnings errors succinct, helpful messaging around function expects inputs. inputs admiral functions many, generally fit three categories: datasets, variables arguments. functions start assert_, is_ get_. Utility functions help documentation, testing checking health code base admiral packages. Vignettes working admiral functions, developing unit testing, releases process, vignette writing documentation needs. vignettes intended use across admiral packages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"why-have-a-separate-development-package","dir":"Articles","previous_headings":"","what":"Why have a separate development package?","title":"Get Started","text":"admiral package function base grown decided create extension packages use within companies specific TAs help specific problems. intended extension packages follow processes admiral core, e.g. Unit Testing, Roxygen Documentation, Function Design. standalone development package allows us keep date development process developers across family. also feel lot developer functions user-specific gives us freedom create release utility tools specific family packages reduces non-user facing functions within admiral family packages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"how-to-add-new-tools-to-admiraldev","dir":"Articles","previous_headings":"","what":"How to add new tools to {admiraldev}?","title":"Get Started","text":"Just like admiral, follow procedures adding issues discuss feature requests, bugs documentation updates. develop issues branches Pull Request Code Review. Experimental tools highly encouraged help reduce repetitive patterns automating boring stuff.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"scenario-one-admiral-core","dir":"Articles","previous_headings":"When to add a function to {admiraldev}?","what":"Scenario One: {admiral} core","title":"Get Started","text":"developer working admiral core implements new type derivation function BDS-Findings ADaM dataset. new derivation function two new assert custom checking functions inputs well helper function. Loose guidelines: derivation function always live admiral core. helper function looked see made available within admiraldev extension packages needs reduce repetitive coding across family admiral. generalized, remain admiral. assert custom checking functions always live within admiraldev stay family assertion functions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/admiraldev.html","id":"scenario-two-admiral-extension","dir":"Articles","previous_headings":"When to add a function to {admiraldev}?","what":"Scenario Two: {admiral} extension","title":"Get Started","text":"developer working admiralonco implements new type derivation function adding certain parameters oncology specific ADaM dataset. new derivation function one new assert custom checking function. Loose guidelines: derivation function closely looked see can generalized ADaM datasets. case, moved admiral core. function specific oncology needs, remain admiralonco. assert custom checking functions follow similar principle - can generalized therapeutic areas move admiraldev, whereas specific oncology needs, remain admiralonco.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Guidance for git and GitHub Usage","text":"article give overview admiral project utilizing version-control software git website GitHub working RStudio. go primary branches house source code admiral project well use Feature branches address Issues. Issues can range bugs enhancements identified requested developers, users testers. also provide bare minimum git commands needed get running. Please refer Resource section -depth guidance using git GitHub.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"branches","dir":"Articles","previous_headings":"","what":"Branches","title":"Guidance for git and GitHub Usage","text":"main branch contains latest development version package. can find released versions gh-pages branches contains code used render R package websites - looking right now! patch branch reserved special hot fixes address bugs rarely used. info Hot Fix Release main, gh-pages, patch branches protection. try push changes branches get error unless administrator. Feature branches actual development related specific issue happens. Feature branches merged main pull request merged. Check Pull Request Review Guidance guidance merging main.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"working-with-feature-branches","dir":"Articles","previous_headings":"","what":"Working with Feature Branches","title":"Guidance for git and GitHub Usage","text":"Feature Branches developers work addressing Issues.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"implementing-an-issue","dir":"Articles","previous_headings":"Working with Feature Branches","what":"Implementing an Issue","title":"Guidance for git and GitHub Usage","text":"feature branch must related issue. encourage new developers work one issue time.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"naming-branches","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Naming Branches","title":"Guidance for git and GitHub Usage","text":"name branch must prefixed issue number, followed short meaningful description. example, given issue #94 “Program function derive LSTALVDT”, branch name 94_derive_var_lstalvdt.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"create-a-new-feature-branch-from-the-terminal-from-main","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Create a New Feature Branch from the Terminal (from main)","title":"Guidance for git and GitHub Usage","text":"Checkout main branch: git checkout main Pull latest changes GitHub: git pull Create new branch main branch switch : git checkout -b ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"create-a-new-feature-branch-from-github-from-main","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Create a New Feature Branch from GitHub (from main)","title":"Guidance for git and GitHub Usage","text":"can also create feature branch GitHub. Switch main branch Type new feature branch name Click Create branch: @main main Sure Pull newly created branch RStudio","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"commits-from-the-terminal-in-rstudio","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Commits from the Terminal in RStudio","title":"Guidance for git and GitHub Usage","text":"start commit process, need tell git move changes staging area. Use git add move changes staging area wait next commit. can use git add . move files worked staging area. Next can commit, takes snapshot staged changes. committing, prefix message issue number add meaningful message git commit –m '#94 last alive date implementation'. Lastly, push changes GitHub using git push origin ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"commits-from-the-git-tab-in-rstudio","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Commits from the Git Tab in RStudio","title":"Guidance for git and GitHub Usage","text":"can also make use Git Tab within RStudio commit changes. benefit using Tab able see changes file red green highlighting. Just like terminal, start message issue number add meaningful succinct sentence. Hit Commit button Push GitHub.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"commit-message-etiquette","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Commit Message Etiquette","title":"Guidance for git and GitHub Usage","text":"require developers insert issue number commit message. Placing issue number commit message allows reviewers quickly find discussion surrounding issue. pushed GitHub issue number hyperlinked issue tracker, powerful tool discussion traceability, think valuable highly regulated industry like Pharma. styles commit messaging permitted:","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"style-1","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Style 1:","title":"Guidance for git and GitHub Usage","text":"feat: #94 skeleton function developed chore: #94 styler lintr update docs: #94 parameters details sections compelted","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"style-2","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Style 2:","title":"Guidance for git and GitHub Usage","text":"#94 skeleton function developed #94 styler lintr update #94 parameters details sections compelted","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"style-3","dir":"Articles","previous_headings":"Working with Feature Branches > Implementing an Issue","what":"Style 3:","title":"Guidance for git and GitHub Usage","text":"skeleton function developed (#94) styler lintr update (#94) parameters details sections compelted (#94)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"pull-request","dir":"Articles","previous_headings":"Working with Feature Branches","what":"Pull request","title":"Guidance for git and GitHub Usage","text":"recommend thorough read articles, Pull Request Review Guidance Programming Strategy -depth discussions proper Pull Request.Pull Request authors benefit shorter review times closely following guidance provided two articles. discuss simple git commands terminal GitHub Pull Request. recommend Pull Request GitHub terminal. changes committed, push updated branch GitHub:git push -u origin GitHub, Pull requests, user either “Compare pull request” button /“Create Pull Request”. first button created GitHub detects recent changes made. branch merge must main branch (base = main) compare branch new branch merge - shown picture. Please pay close attention branch merging ! issue must linked pull request “Development” field Pull Request. cases, linkage automatically close issue move Done column project board. completed Pull Request see committed changes available reviewer. reviewer must specified Pull Request. recommended write brief summary reviewers can quickly come speed Pull Request. Images updates nice , easy GitHub! Use Screen Capture software Copy Paste summary.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"reviewingclosing-an-issue","dir":"Articles","previous_headings":"Working with Feature Branches > Pull request","what":"Reviewing/Closing an Issue","title":"Guidance for git and GitHub Usage","text":"least one reviewer must approve Pull Request. Please review Pull Request Review Guidance, provides depth guidance proper Pull Request. reviewer must ensure function follows programming strategy recommendations. comment/question/discussion must addressed documented GitHub Pull Request merged review completed, reviewer merge Pull Request feature branch automatically deleted. merging Pull Request please check corresponding moved done column Project Board. Also, please make sure issue closed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"solving-merge-conflicts-in-the-terminal-on-rstudio","dir":"Articles","previous_headings":"Working with Feature Branches > Pull request","what":"Solving Merge Conflicts in the Terminal on RStudio","title":"Guidance for git and GitHub Usage","text":"Merge conflict situation git decide changes apply since multiple updates part file. typically happens multiple people update part code. conflicts always need handled manually (code updates may required): provides list files conflicts file conflicts conflicting sections marked <<<<<<<, =======, >>>>>>>. code markers must updated markers removed. Source files need updated manually. Generated files like NAMESPACE generated documentation files updated manually recreated source files updated. make changes available call:","code":"git checkout main git pull git checkout git merge main git add git commit -m \"\" git push"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"solving-merge-conflicts-in-github","dir":"Articles","previous_headings":"Working with Feature Branches > Pull request","what":"Solving Merge Conflicts in GitHub","title":"Guidance for git and GitHub Usage","text":"simple merge conflicts, developers can make use GitHub interface solve . GitHub show number conflicts two branches. image, GitHub found 3 conflicts, display first one. Just like terminal, GitHub make use <<<<<<<, =======, >>>>>>> highlight conflicting sections. need make decision whether keep code base feature branch. decided, go code remove section longer wish keep. sure remove <<<<<<<, =======, >>>>>>> well! work conflicts mark Resolved Commit changes. recommended pull branch back RStudio make sure untoward effects happen branch.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"useful-git-commands","dir":"Articles","previous_headings":"Working with Feature Branches","what":"Useful git Commands","title":"Guidance for git and GitHub Usage","text":"merging: git merge - merge my_branch current branch stashing commands useful one wants go back clean directory git stash - stash (store) current changes restore clean directory git stash pop - put back (restore) stashed changes git revert also helpful ? Using code unmerged branches Checkout unmerged branch want use: git checkout Pull latest committed changes unmerged branch: git pull Check feature branch: git checkout Merge unmerged branch : git merge ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/git_usage.html","id":"github_resources","dir":"Articles","previous_headings":"","what":"Resources on using git, GitHub and RStudio","title":"Guidance for git and GitHub Usage","text":"GitHub RStudio Happy Git GitHub useR","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/package_extensions.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Package Extensions","text":"admiral made family packages foresee growing time cover specific areas TA (Therapeutic Area) package extensions, wider range companies individuals getting board join development efforts. step--step guidance talks recommendations new development teams go creating package extensions. critical guidance followed, users need feel consistent experience working across admiral packages. admiral package extension doesn’t follow conventions wouldn’t include pharmaverse part admiral family.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/package_extensions.html","id":"step-by-step-guidance-to-create-a-package-extension","dir":"Articles","previous_headings":"","what":"Step-by-step Guidance to Create a Package Extension","title":"Package Extensions","text":"Note: ordering numbers suggested don’t need strictly followed sequence. Raise need new admiral package extension pharmaverse Slack channel, directly admiral package maintainer. naming convention needs {admiralxxx} request scope targeted overly narrow, example instead package extension HIV ’d prefer one across virology. Otherwise number packages may become unmanageable. agreed, reach company contacts working similar areas see collaborative development can achieved. recommendation always target least 2 companies start implementation remains robust protect going company-specific route. However, consider 4 5 companies get involved early may slow decision-making. companies agree co-develop, identify lead . One company act driver overall package extension put forward product owner technical lead ultimately final say contentious decisions. product owner cover project decisions (e.g. around scope priorities), whereas technical lead cover technical decisions (e.g. around design implementation). technical lead either: ) already significantly involved admiral core development team developer/contributor, b) join core development team simultaneously. ensure design kept true manifesto consistent style quality respect admiral standards. Agree charter expectations company, e.g. usually ask least 3 developers least 25% capacity mix R, GitHub TA experience. Within charter make sure scope timelines clear. important try boil ocean. Focus first common endpoints required foundation package can build via contributions co-development companies also wider across-industry admiral community. useful, admiralonco charter shared guide. company start identify required developer resources. developer required complete {admiral} dummy issue onboarding, well reading admiraldev documentation, - especially developer guides, need followed package extensions. Optionally can useful host kick-meeting decide team work, recommend agile/scrum practices. Set “admiralxxx_dev” channel Slack add team members informal team chat, agree way share working documents across co-development team. recommend use new folder pharmaverse MS Teams - Michael Rimler (michael.s.rimler@gsk.com) help rep PHUSE board. useful starter development activity look pharmaversesdtm check test data sufficient TA needs, e.g. admiralonco generate new test data SDTM domains RS TU. Note personal data used (even anonymized) important keep data generated -line CDISC pilot data use , .e. use USUBJIDs DM etc. Optionally draft, agree sign collaboration agreement collaborating companies wish, useful protecting secondary IP company standard specifications may shared within team. example stored , work Legal teams required. Share company-specific implementations specifications able harmonize design strategy package extension. important remain pragmatic consider higher perspective one company. Engage company standards representatives find discrepancies across company approaches question really need things differently (health authorities patients benefit ?). Also consider always expect level company-specifics covered internal company package extensions. Set new public GitHub repo pharmaverse org using admiraltemplate - includes set-pieces (CI/CD checks issue/PR templates) enable package stay consistent others admiral family, well core package dependencies versions. See {admiraltemplate} Quick Start Guide Note step requires org member access granted pharmaverse council reps, admins org. Also free add additional package dependencies needed assuming reliable packages used, must depend newer versions packages (always reply “” updates suggested installation). repo available technical lead granted admin access repo set GitHub team name package extension assign required access co-development team members. require write access, may choose give leads admin access well never bottle-neck waiting one person. Update template license file repo adding co-development company names place Roche & GSK - admiral package extensions use Apache 2.0, preferred permissive license. Agree co-development companies required extra wording copyright/IP section. Set project board, , help manage backlog. Assuming work agile/scrum, create product backlog, prioritize make sprint plan. intention always re-use much possible admiral core package. find anything additional needed package extension, first question whether might common need TAs consider instead raising issue admiral core. designing new functions always try stay aligned Programming Strategy. Start development foundational first release 0.1.0. Follow consistent Development Process admiral. Line testers companies others set expectations around believe stable version available user testing. can use admiral Slack community raise interest get involved. Add pharmaverse badge README: https://pharmaverse.org/contribute/badges/ - needs support pharmaverse council rep. Raise admiral repo issue ensure package extension site linked core admiral site .` important admiral family packages keep similar release schedule cadence, order ease adoption users give clear expectations. admiral core package cadence releases one every quarter fixed schedule (every first Monday last month quarter - March, June, September, December). core package set release schedule package extensions follow, .e. admiral releases ’d expect package extension releases targeted within 2 week window. releases communicated via Slack channel well quarterly user community meetings. happy package extension well tested sufficient state make submission CRAN. technical lead named maintainer. CRAN release, advertise via Slack & LinkedIn. Plan future enhancements make issues. team feels ready can open development contributions wider community - see page. Please use good first issue (ideal new starters) & help wanted (ideal experienced contributors) issue labels. Note: core admiral team carry periodic reviews extension package contents ensure nothing duplicated ensure standards best practices followed. frequency reviews agreed upon technical leads core extension packages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/package_extensions.html","id":"lessons-learned","dir":"Articles","previous_headings":"","what":"Lessons Learned","title":"Package Extensions","text":"lessons learned previous package extensions: Since ADaM conceived TA-agnostic, TA standards can widely differ across companies, TA package extensions shouldn’t contain many new functions. , functionality required create ADaM present admiral, localized limited exceptions truly TA-specific variables/endpoints. , R folder package extensions relatively lean! Connected , package extension just R functions - also vignettes examples template programs. fact, just important R functions , users turn guidance. Making sure package always --date respect new admiral releases (e.g. due deprecation functions) crucial task. Maintaining package long-term way ensure success. Beware developing just sake developing! may find reach point stasis extension package journey, much need new development. case, vital avoid working tangential tasks. Instead, focus ensuring existing fit--purpose possible.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Pull Request Review Guidance","text":"document intended guidance creators reviewers pull requests (PRs) admiral package family. PR authors benefit shorter review times closely following guidance provided . pull request main branch signifies issue “addressed”. issue might bug, feature request documentation update. Pull Request merged main branch, issue(s) can closed. Closely following guidance ensure “addressed” issues auto-close merge main.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"review-criteria","dir":"Articles","previous_headings":"","what":"Review Criteria","title":"Pull Request Review Guidance","text":"pull request merged main needs pass automated CI checks appear bottom Pull Request. addition, PR creator reviewer make sure Programming Strategy Development Process followed function ADaM IG compliant function intended (described header corresponding issue) function header properly explains intention function, expected inputs (incl. permitted values parameters) output produced; reading documentation reader able predict output function without read source code function accompanying set unit tests; derivations unit test code coverage least 90%; whole package coverage >= 80% implemented derivation scope admiral, e.g. expect company specific input hard-code company-specific rules meaningful error warning messages issued input invalid documentation created/updated running devtools::document() functions supposed exported listed NAMESPACE file; requires @export tag function header examples print relevant source variables newly created variables /records output NEWS.md file updated entry explains new features changes change user-specific warrants mention development milestone files affected implemented changes, e.g. vignettes templates, updated","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"codeowners-and-pr-guidance","dir":"Articles","previous_headings":"Review Criteria","what":"Codeowners and PR Guidance","title":"Pull Request Review Guidance","text":"creator PR, assignment reviewer can unclear. PRs, feel free select members core development team. individuals scan repository regular basis well may provide /review even originally included selected reviewer. Sometimes, development function vignette falls specific-topic, e.g. labs PK/PD. Please ensure include appropriate reviewer modifying files rely domain-expertise. try maintain active list domain-specific topics automatically tag appropriate reviewer using CODEOWNERS file, located .github folder. interested codeowner, reach development team.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"so-much-red-tape","dir":"Articles","previous_headings":"","what":"So much Red Tape!","title":"Pull Request Review Guidance","text":"admiral development team aware sympathetic great many checks, processes documents needed work order compliant Pull Request. task-list-completed GitHub workflow created help reduce burden contributors providing standardized checklist compiles information Pull Request Review Guidance, Programming Strategy Development Process vignettes. next three sections give high-level overview contributor faces opening PR, contributor interacts task-list-completed workflow PR.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"open-a-pull-request","dir":"Articles","previous_headings":"So much Red Tape!","what":"Open a Pull Request","title":"Pull Request Review Guidance","text":"contributor opens PR lengthy standard text inserted comment section. Please alter automated text. need manually add Closes # title Pull Request. can use Edit button top right forget step start Pull Request. Besides free add additional textual information, screenshots, etc. bottom automated text needed clarify contribute discussion around PR.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"create-a-pull-request","dir":"Articles","previous_headings":"So much Red Tape!","what":"Create a Pull Request","title":"Pull Request Review Guidance","text":"click green Create pull request button automated text inserted turned checklist Pull Request. check box drawn previously mentioned vignettes presented recommended sequence. check boxes meant helpful aid ensuring created compliant Pull Request.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"complete-the-pull-request-checklist","dir":"Articles","previous_headings":"So much Red Tape!","what":"Complete the Pull Request checklist","title":"Pull Request Review Guidance","text":"check boxes linked task-list-completed workflow. need check box acknowledgment done due diligence creating compliant Pull Request. GitHub refresh Pull Request trigger task-list-completed workflow completed task. PR can merged main contributor checked check box items. Please don’t hesitate reach admiral team Slack GitHub Issues tracker think checklist needs amended clarity needed check box item. Note Reviewers: recommend use Squash Merge merging Pull Request. create clean commit history.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"github-actionsci-workflows","dir":"Articles","previous_headings":"","what":"GitHub Actions/CI Workflows","title":"Pull Request Review Guidance","text":"task-list-completed workflow one several workflows/actions used within admiral. workflows live .github/workflows folder important understand use remedy workflow fails. Workflows defined responsible assuring high package quality standards without compromising performance, security, reproducibility.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/pr_review_guidance.html","id":"a-synopsis-of-admirals-workflows","dir":"Articles","previous_headings":"GitHub Actions/CI Workflows","what":"A synopsis of admiral’s workflows","title":"Pull Request Review Guidance","text":"recommend checking README admiralci repository gain understanding workflows/actions used admiral.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Programming Strategy","text":"admiral intended contributed user community, article meant developers want either expand admiral functionalities build top admiral. order keep framework robust across whole community, defined programming strategy followed cases. contributions include, example, company specific derivations ADaM datasets.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"functional-workflow","dir":"Articles","previous_headings":"","what":"Functional Workflow","title":"Programming Strategy","text":"Overall programming follow functional approach. mandate use tidyverse (e.g. dplyr) similar functionality existing base R ADaM dataset built set functions free flow code. ADaM dataset specific programming workflow. function specific purpose supports ADaM Dataset programming workflow. admiral function company specific function. Admiral functions can re-used company specific functions. function belongs one category defined keywords/family. function used derive one multiple variable(s) required unit tested. Functions standard naming convention. Double coding used QC method (absolutely necessary). ADaMs created readable, submission-ready code.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-design","dir":"Articles","previous_headings":"Functions in R","what":"Function Design","title":"Programming Strategy","text":"Firstly, important explain decide need new derivation functions. derivation rule algorithm common highly similar across different variables/parameters (e.g. study day duration) provide generic function can used satisfy times may needed across different ADaMs. Similarly, feel certain derivation useful beyond single purpose also provide generic function (e.g. instead last known alive date function, extreme date function user find last date selection, example first). Otherwise, feel derivation rule unique need sufficiently complex justify opt dedicated function specific variable/parameter (e.g. treatment-emergent flag AEs). certain variables closely connected (e.g. imputed date corresponding imputation flag) single function provide variables. something needed ADaM achieved simply via existing tidyverse function, wrap admiral function, add unnecessary extra layer users. following principles key designing new function: Modularity - code follows modular approach, .e. steps must clearly separated dedicated purpose. applies scripts creating dataset module create single variable parameter. also complex derivations several steps. Commenting steps key readability. Avoid Copy Paste - similar code used multiple times, put separate function. improves readability maintainability makes unit testing easier. done every simple programming step tidyverse can used. rather computational functions data checks. However, also consider nest many functions. Checks - Whenever function fails, meaningful error message must provided clear reference input caused failure. users dig detailed code want apply function. meaningful error message supports usability. Flexibility - Functions flexible possible long reduce usability. example: source variables newly created variables conditions selecting observations hard-coded. useful argument triggers optional steps, e.g. filter argument specified, input dataset restricted, otherwise step skipped. However, arguments trigger completely different algorithms. example BNRIND derived based BASE based ANRIND. implemented within one function algorithms completely different. BASE used, values categorized ANRIND used, values merged baseline observation.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"input-output-and-side-effects","dir":"Articles","previous_headings":"Functions in R","what":"Input, Output, and Side-effects","title":"Programming Strategy","text":"behavior function determined input, global object, .e. input like datasets, variable names, options, … must provided function arguments. expected input datasets grouped. grouped, function must issue error. function requires grouping, function must provide by_vars argument. output dataset must ungrouped. functions sort (arrange) output dataset end. function needs create temporary variables input dataset, names variables must generated get_new_tmp_var() avoid variables input dataset accidentally overwritten. temporary variables must removed output dataset calling remove_tmp_vars(). developers find need use create environment objects achieve flexibility, use admiral_environment environment object created admiral_environment.R. objects stored environment must documented admiral_environment.R. equivalent environment object .R file exist admiraldev well. details environments work, see relevant sections environments R Packages Advanced R textbooks. general, function must side-effects like creating modifying global objects, printing, writing files, …","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"admiral-options","dir":"Articles","previous_headings":"Functions in R","what":"Admiral Options","title":"Programming Strategy","text":"exception made admiral options, see get_admiral_option() set_admiral_options(), certain pre-defined defaults added flexibility allow user-defined defaults commonly used function arguments e.g. subject_keys currently pre-defined exprs(STUDYID, USUBJID), can modified using set_admiral_options(subject_keys = exprs(...)) top script. reasoning behind relieve user repeatedly changing aforementioned commonly used function arguments multiple times script, may called across many admiral functions. additional flexibility needs added another commonly used function argument e.g. future_input set exprs(...) can added admiral option. function formals define future_input = get_admiral_option(\"future_input\") proceed modify body roxygen documentation set_admiral_options().","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-names","dir":"Articles","previous_headings":"Functions in R","what":"Function Names","title":"Programming Strategy","text":"Function names start verb use snake case, e.g. derive_var_base(). Please note appropriate var/vars prefix used cases function creates variable(s), regardless presence new_var argument function call. Oftentimes creating new derive_var derive_param function may sort non-trivial calculation involved may want write customized function . creating compute_ function becomes appropriate, calculation portion contained one step part overall derive_ function, reducing clutter main function body assisting debugging. addition, compute_ function implemented calculation used one derivation. example compute_bmi() used derive baseline BMI variable ADSL (based baseline weight baseline height variables) also used derive BMI parameter ADVS (based weight height parameters). Please see compute_age_years() derive_var_age_years() another example.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-arguments","dir":"Articles","previous_headings":"Functions in R","what":"Function Arguments","title":"Programming Strategy","text":"default value optional arguments NULL. recommended argument order contributors asked adhere (order keep consistency across functions): dataset (additional datasets denoted dataset_*) by_vars order new_var (related new_var_* arguments) filter (additional filters denoted filter_*) Make sure always mention start_date end_date (related). Names variables inside dataset passed symbols rather strings, .e. AVAL rather \"AVAL\". argument accepts one variables expressions input variables expressions wrapped inside exprs(). example: new_var = TEMPBL by_vars = exprs(PARAMCD, AVISIT) filter = PARAMCD == \"TEMP\" order = exprs(AVISIT, desc(AESEV)) new_vars = exprs(LDOSE = EXDOSE, LDOSEDT = convert_dtc_to_dt(EXSTDTC)) function argument needs tested assert_ type function. expression needs tested following (many utility functions admiral available contributor): whether expression (list expressions, depending function) whether valid expression (.e. whether evaluates without error)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"common-function-arguments-naming-convention","dir":"Articles","previous_headings":"Functions in R","what":"Common Function Arguments Naming Convention","title":"Programming Strategy","text":"first argument derive_ functions input dataset named dataset. one input dataset required, input dataset start dataset_, e.g., dataset_ex. Arguments specifying items add start new_. variable added, second part argument name var, parameter added, param. example: new_var, new_var_unit, new_param. Arguments expect boolean boolean vector must start verb, e.g., is_imputed impute_date. Arguments expect one value variable name must singular version word(s), e.g., missing_value new_var. Arguments expect several values variable names (list, expressions, etc.) must plural version word(s), e.g., missing_values new_vars.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"source-code-formatting","dir":"Articles","previous_headings":"Functions in R","what":"Source Code Formatting","title":"Programming Strategy","text":"source code formatted according tidyverse style guide. lintr styler packages used check enforce .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"comments","dir":"Articles","previous_headings":"Functions in R","what":"Comments","title":"Programming Strategy","text":"Comments added help readers author understand code. two main cases: intention chunk code clear, comment added. comment rephrase code provide additional information. Bad Good long functions (>100 lines) comments can added structure code simplify navigation. case comment end ---- add entry document outline RStudio. example: formatting comments must follow tidyverse style guide. .e., comment start single # space. decoration (except outline entries) must added. Bad Good","code":"# If AVAL equals zero, set it to 0.0001. Otherwise, do not change it mutate(dataset, AVAL = if_else(AVAL == 0, 0.0001, AVAL)) # AVAL is to be displayed on a logarithmic scale. # Thus replace zeros by a small value to avoid gaps. mutate(dataset, AVAL = if_else(AVAL == 0, 0.0001, AVAL)) # Check arguments ---- # This is a comment # ########################### # This is another comment # ########################### #+++++++++++++++++++++++++++++++ # This is a section comment ---- #+++++++++++++++++++++++++++++++ # This is a comment # This is another comment # This is a section comment ----"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"input-checking","dir":"Articles","previous_headings":"Functions in R","what":"Input Checking","title":"Programming Strategy","text":"line fail-fast design principle, function inputs checked validity , ’s invalid input, function stop immediately error. exception case variable added function already exists input dataset: warning displayed function continue executing. Inputs checked using custom assertion functions defined R/assertions.R. custom assertion functions either return error case invalid input return nothing. common types input arguments like single variable, list variables, dataset, … functions checking available (see assertions). Arguments expect keywords handle case-insensitive manner, e.g., date_imputation = \"FIRST\" date_imputation = \"first\" accepted. assert_character_scalar() function helps handling arguments case-insensitive manner. argument checked outer function argument name inner function. rule applicable functions part admiral.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function-header-documentation","dir":"Articles","previous_headings":"Functions in R","what":"Function Header (Documentation)","title":"Programming Strategy","text":"Every function exported package must accompanying header formatted according roxygen2 convention. addition standard roxygen2 tags, @family @keywords tags also used. family/keywords used categorize function, used website internal package help pages. Please see section Categorization functions. example given : following fields mandatory: @param: One entry per function argument. following attributes described: expected data type (e.g. data.frame, logical, numeric etc.), permitted values (applicable), optionality (.e. required argument). expected input dataset required variables clearly stated. Describing default value becomes difficult maintain subject manual error already declared function arguments. description permitted values written separate line italicizing phrase “Permitted Values”, example : @details: natural-language description derivation used inside function. @keyword: One applicable tag function - identical family. @family: One applicable tag function - identical keyword. @return: description return value function. newly added variable(-s) mentioned . @examples: fully self-contained example use function. Self-contained means , code executed new R session, run without errors. means packages need loaded library() datasets needed either created directly inside example code loaded using data(). dataset created example, done using function tribble() (specify library(dplyr) calling function). functions called example, please specify library(pkg_name) refer respective function fun() opposed preferred pkg_name::fun() notation specified Unit Test Guidance. Make sure align columns ensures quick code readability. Copying descriptions avoided makes documentation hard maintain. example argument description used one function, argument described one function functions use @inheritParams . Please note @inheritParams func_first used header func_second() function, argument descriptions func_first() included documentation func_second() argument offered func_second() @param tag argument included header func_second(). order @param tags function definition. @inheritParams tags @param. affect order argument description rendered documentation makes easier maintain headers. Variable names, expressions, functions, code must enclosed backticks. render code. functions derive specific CDISC variable, title must state label variable without variable name. variable stated description.","code":"#' Derive Relative Day Variables #' #' Adds relative day variables (`--DY`) to the dataset, e.g., `ASTDY` and #' `AENDY`. #' #' @param dataset Input dataset #' #' The columns specified by the `reference_date` and the `source_vars` #' argument are expected. #' #' @param reference_date The start date column, e.g., date of first treatment #' #' A date or date-time object column is expected. #' #' Refer to `derive_var_dt()` to impute and derive a date from a date #' character vector to a date object. #' #' @param source_vars A list of datetime or date variables created using #' `exprs()` from which dates are to be extracted. This can either be a list of #' date(time) variables or named `--DY` variables and corresponding --DT(M) #' variables e.g. `exprs(TRTSDTM, ASTDTM, AENDT)` or `exprs(TRTSDT, ASTDTM, #' AENDT, DEATHDY = DTHDT)`. If the source variable does not end in --DT(M), a #' name for the resulting `--DY` variable must be provided. #' #' @details The relative day is derived as number of days from the reference #' date to the end date. If it is nonnegative, one is added. I.e., the #' relative day of the reference date is 1. Unless a name is explicitly #' specified, the name of the resulting relative day variable is generated #' from the source variable name by replacing DT (or DTM as appropriate) with #' DY. #' #' @return The input dataset with `--DY` corresponding to the `--DTM` or `--DT` #' source variable(s) added #' #' @keywords der_date_time #' @family der_date_time #' #' @export #' #' @examples #' library(lubridate) #' library(dplyr, warn.conflicts = FALSE) #' #' datain <- tribble( #' ~TRTSDTM, ~ASTDTM, ~AENDT, #' \"2014-01-17T23:59:59\", \"2014-01-18T13:09:O9\", \"2014-01-20\" #' ) %>% #' mutate( #' TRTSDTM = as_datetime(TRTSDTM), #' ASTDTM = as_datetime(ASTDTM), #' AENDT = ymd(AENDT) #' ) #' #' derive_vars_dy( #' datain, #' reference_date = TRTSDTM, #' source_vars = exprs(TRTSDTM, ASTDTM, AENDT) #' ) #' *Permitted Values*: example description of permitted values here"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"categorization-of-functions","dir":"Articles","previous_headings":"Functions in R","what":"Categorization of Functions","title":"Programming Strategy","text":"functions categorized keywords families within roxygen header. Categorization important admiral user-facing functions base totals 125 growing! However, ease burden developers, decided keywords families identical roxygen header, specified via @keywords @family fields. reiterate, function must use keyword family. Also, please note keywords families case-sensitive.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"keywords","dir":"Articles","previous_headings":"Functions in R > Categorization of Functions","what":"@keywords","title":"Programming Strategy","text":"keywords allows reference page easily organized using certain pgkdown functions. example, using function has_keyword(der_bds_gen) _pkgdown.yml file building website collect BDS General Derivation functions display alphabetical order Reference Page section called BDS-Specific.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"family","dir":"Articles","previous_headings":"Functions in R > Categorization of Functions","what":"@family","title":"Programming Strategy","text":"families allow similar functions displayed See Also section function’s documentation. example, user looking derive_vars_dy() function documentation might interested Date/Time functions. Using @family tag der_date_time display Date/Time functions available admiral user See Also section derive_vars_dy() function documentation. Please take look function documentation derive_vars_dy() see family tag action. list available keyword/family tags used admiral functions. think additional keyword/family tag added, please add issue GitHub discussion. NOTE: strongly encouraged @keyword @family identical. eases burden development maintenance admiral functions. need use multiple keywords families, please reach core development team discussion.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"missing-values","dir":"Articles","previous_headings":"","what":"Missing values","title":"Programming Strategy","text":"Missing values (NAs) need explicitly shown. Regarding character vectors converted SAS files: SAS treats missing character values blank. imported R empty strings (\"\") although nature missing values (NA). empty strings originate like need converted proper R missing values NA.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"file-structuring","dir":"Articles","previous_headings":"","what":"File Structuring","title":"Programming Strategy","text":"Organizing functions files art science. Thus, hard rules just recommendations. First foremost, two extremes avoided: putting function file putting functions single file. Apart following recommendations taken consideration deciding upon file structuring: function long (together documentation), store separate file functions documented together, put one file functions sort commonality relevance one another (like dplyr::bind_rows() dplyr::bind_cols()), put one file Store functions together helpers methods 1000 lines single file, unless necessary (exceptions , example, classes methods) responsibility author new function reviewer ensure recommendations put practice.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"r-package-dependencies","dir":"Articles","previous_headings":"","what":"R Package Dependencies","title":"Programming Strategy","text":"Package dependencies documented DESCRIPTION file. package used examples /unit tests listed Suggests, otherwise Imports. Functions packages explicitly imported using @importFrom tag R/admiral-package.R file. import if_else() mutate() function dplyr following line included file: #' @importFrom dplyr if_else mutate. using @importFrom tag, easier track dependencies one place improves code readability. functions become critically important using admiral included export. applies functions frequently called within {admiral }function calls like rlang::exprs(), dplyr::desc() pipe operator dplyr::%>%. export functions, following R code included R/reexports.R file using format:","code":"#' @export pkg_name::fun"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"metadata","dir":"Articles","previous_headings":"","what":"Metadata","title":"Programming Strategy","text":"Functions perform derivation logic add kind metadata, e.g. labels.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"unit-testing","dir":"Articles","previous_headings":"","what":"Unit Testing","title":"Programming Strategy","text":"function requires set unit tests verify produces expected result. See Writing Unit Tests {admiral} details.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"deprecation","dir":"Articles","previous_headings":"","what":"Deprecation","title":"Programming Strategy","text":"deprecation strategy provides stability users allowing admiral developers ability remove update code base coming days. Phase 1: release identified function argument deprecated, message issued using function argument using deprecate_inform(). message appear user least one year. Templates, vignettes internal calls updated use new recommended function/argument. Phase 2: least one year closet next release, warning issued using function argument using deprecate_warn(). warning message appear least one year. Phase 3: least one year closest next release, error thrown using function argument using deprecate_stop() follow similar process Phase 1 Phase 2. Phase 4: Finally three years time identified deprecation, function argument completely removed admiral. NB: Major/Minor release make sense deprecation updates. However, release cycle becomes multiple years, patch releases considered help keep admiral neat tidy! NB: Take care NEWS.md entries around deprecation person continuing process might !","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"documentation","dir":"Articles","previous_headings":"Deprecation","what":"Documentation","title":"Programming Strategy","text":"function argument removed, documentation must updated indicate function argument now deprecated new function/argument used instead. documentation updated Phase 1: description level function lifecycle badge added, @keywords @family roxygen tags replaced deprecated Example documentation argument level @param level argument. documentation updated Phase 3: @examples section removed.","code":"#' Title of the function #' #' @description #' `r lifecycle::badge(\"deprecated\")` #' #' This function is *deprecated*, please use `new_fun()` instead. #' . #' @family deprecated #' @keywords deprecated @param old_param `r lifecycle::badge(\"deprecated\")` Please use `new_param` instead."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"handling-of-messages-warnings-and-errors","dir":"Articles","previous_headings":"Deprecation","what":"Handling of Messages, Warnings and Errors","title":"Programming Strategy","text":"function argument deprecated, function must updated issue message, warning error using deprecate_inform(), deprecate_warn() deprecate_stop(), respectively, described . test case added test file function checks whether message/warning/error issued appropriate using deprecated function argument.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"function","dir":"Articles","previous_headings":"Deprecation > Handling of Messages, Warnings and Errors","what":"Function","title":"Programming Strategy","text":"Phase 1: start phase call deprecate_inform() appear : NB: Please adjust phrase {beginning 20XX} relevant timeline. code deprecated function replaced call new function used instead. Phase 2: start phase call deprecate_warn() appear : NB: Please adjust phrase {beginning 20XX} relevant timeline. Phase 3: start phase call deprecate_stop() appear : Phase 4: Function removed package.","code":"fun_xxx <- function(dataset, some_param, other_param) { deprecate_inform( when = \"x.y.z\", what = \"fun_xxx()\", with = \"new_fun_xxx()\", details = c( x = \"This message will turn into a warning {at the beginning of 20XX}.\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) ) new_fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param ) } fun_xxx <- function(dataset, some_param, other_param) { deprecate_warn( when = \"x.y.z\", what = \"fun_xxx()\", with = \"new_fun_xxx()\", details = c( x = \"This message will turn into a error {at the beginning of 20XX}.\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) ) new_fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param ) } fun_xxx <- function(dataset, some_param, other_param) { deprecate_stop( when = \"x.y.z\", what = \"fun_xxx()\", with = \"new_fun_xxx()\" ) new_fun_xxx( dataset = dataset, some_param = some_param, other_param = other_param ) }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"argument","dir":"Articles","previous_headings":"Deprecation > Handling of Messages, Warnings and Errors","what":"Argument","title":"Programming Strategy","text":"Phase 1: argument renamed replaced, message must issued new argument takes value old argument next phase. Note: arguments passed exprs() argument (e.g. new_var = VAR1 filter = AVAL > 10) need quoted. Phase 2: argument renamed replaced, warning must issued new argument takes value old argument next phase Note: arguments passed exprs() argument (e.g. new_var = VAR1 filter = AVAL > 10) need quoted. Phase 3: argument removed replaced, error must generated: Phase 4: mentions argument completely removed admiral.","code":"if (!missing(old_param)) { deprecate_inform(\"x.y.z\", \"fun_xxx(old_param = )\", \"fun_xxx(new_param = )\") # old_param is given using exprs() new_param <- old_param # old_param is NOT given using exprs() new_param <- enexpr(old_param) } if (!missing(old_param)) { deprecate_warn(\"x.y.z\", \"fun_xxx(old_param = )\", \"fun_xxx(new_param = )\") # old_param is given using exprs() new_param <- old_param # old_param is NOT given using exprs() new_param <- enexpr(old_param) } if (!missing(old_param)) { deprecate_stop(\"x.y.z\", \"fun_xxx(old_param = )\", \"fun_xxx(new_param = )\") }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"unit-testing-1","dir":"Articles","previous_headings":"Deprecation","what":"Unit Testing","title":"Programming Strategy","text":"Unit tests deprecated functions arguments must added test file 1 function ensure message, warning, error issued. unit-test follow corresponding format, per unit test guidance.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"for-deprecated-functions-that-issue-a-message-phase-1","dir":"Articles","previous_headings":"Deprecation > Unit Testing","what":"For Deprecated Functions that Issue a Message (Phase 1)","title":"Programming Strategy","text":"Please put tests deprecation top test file make finding specific test easier next phase deprecation. Tests call multiple functions deprecation messages can wrapped using parentheses curly brackets, e.g. expect_snapshot({}). can use withr::local_options(list(lifecycle_verbosity = \"quiet\")) suppress deprecation messages already created tests.","code":"## Test 1: deprecation message if function is called ---- test_that(\"derive_var_example() Test #: deprecation message if function is called\", { expect_snapshot({ ae <- date_source(...) ... derive_var_example(...) }) }) ## Test 2: Test of function argument 1 ---- test_that(\"derive_var_example() Test 2: Test of function argument 1\", { withr::local_options(list(lifecycle_verbosity = \"quiet\")) ... })"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"for-deprecated-functions-that-issue-a-warning-phase-2","dir":"Articles","previous_headings":"Deprecation > Unit Testing","what":"For Deprecated Functions that Issue a Warning (Phase 2)","title":"Programming Strategy","text":"snapshot deprecation message test must updated instead message warning issued now.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"for-deprecated-functions-that-issue-an-error-phase-3","dir":"Articles","previous_headings":"Deprecation > Unit Testing","what":"For Deprecated Functions that Issue an Error (Phase 3)","title":"Programming Strategy","text":"unit test like following must added. writing unit test, check error right class, .e., \"lifecycle_error_deprecated\". unit tests deprecated function must removed.","code":"## Test #: error if function is called ---- test_that(\"derive_var_example() Test #: deprecation error if function is called\", { expect_error( derive_var_example(), class = \"lifecycle_error_deprecated\" ) })"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"best-practices-and-hints","dir":"Articles","previous_headings":"","what":"Best Practices and Hints","title":"Programming Strategy","text":"Please take following list recommendation try adhere rules possible. Arguments function calls named except first parameter (e.g. assert_data_frame(dataset, required_vars = exprs(var1, var2), optional = TRUE)). dplyr::if_else() used two conditions. Try always set missing argument whenever appropriate.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"how-quoting-is-used","dir":"Articles","previous_headings":"Best Practices and Hints","what":"How Quoting is used","title":"Programming Strategy","text":"admiral arguments require selecting one particular option like mode, e.g. mode = \"last\". Use quotation marks capture . expected assertion function corresponding arguments assert_character_scalar()/assert_character_vector(). Many admiral arguments require capturing expression, typically encased exprs() statement, evaluated later inside function body, see arguments like new_vars, e.g. new_vars = exprs(TRTSDTM = EXSTDTM). Oftentimes, assertion function corresponding assert_expr()/assert_expr_list(). arguments unquoted using !!!. admiral arguments like new_var filter expect single variable expression quoted call. function body, quoted using enexpr(). Usually combined assertion, e.g., new_var <- assert_symbol(enexpr(new_var)). arguments unquoted using !!. Keep mind !! one--one replacement !!! one--many replacement. Please see chapter Advanced R textbook details.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"standardizing-text-used-to-label-and-describe-arguments","dir":"Articles","previous_headings":"Best Practices and Hints","what":"Standardizing Text Used to Label and Describe Arguments","title":"Programming Strategy","text":"following PR, find example function argument dataset able standardized Label Description said function argument aligned across codebase. Please see changes file derive_adeg_params.R details. benefits programmatic way write documentation changes need made, making modification corresponding function, case, roxygen_param_dataset(), scales across codebase, can tested, less prone user-error typos grammar mistakes. functions implemented roxygen2.R naming convention argument follows roxygen_param_xxx(), “xxx” replaced argument name.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html","id":"r-and-package-versions-for-development","dir":"Articles","previous_headings":"","what":"R and Package Versions for Development","title":"Programming Strategy","text":"choice R Version Package versions set stone. However, common development environment important establish working across multiple companies multiple developers. currently recommend developers work latest R version latest available packages. However, deviate time developers come go admiral. actually see positive, .e. deviations developers, introduces bit random stress testing code base. GitHub allows us Actions/Workflows test admiral several versions R well several versions dependent R packages needed admiral. Currently test admiral two latest R Versions closest snapshots packages R versions. can view workflow others admiralci GitHub Repository.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"common-r-cmd-check-issues","dir":"Articles","previous_headings":"","what":"Common R CMD Check Issues","title":"R CMD Issues","text":"R CMD check command line tool checks R packages standard set criteria. pull request pass check must issue notes, warnings errors. list common issues resolve .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"check-fails-only-on-one-version","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Check Fails Only on One Version","title":"R CMD Issues","text":"R CMD check workflow fails one two R versions can helpful reproduce testing environment locally. reproduce particular R version environment open admiral project corresponding R version, comment line source(\"renv/activate.R\") .Rprofile file, restart R session run following commands R console. ensure exact package versions use workflow installed hidden folder .library. way existing R packages overwritten.","code":"Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS = \"true\") if (!dir.exists(\".library\")) { dir.create(\".library\") } base_recommended_pkgs <- row.names(installed.packages(priority = \"high\")) for (pkg in base_recommended_pkgs) { path <- file.path(.Library, pkg) cmd <- sprintf(\"cp -r %s .library\", path) system(cmd) } assign(\".lib.loc\", \".library\", envir = environment(.libPaths)) r_version <- getRversion() if (grepl(\"^4.1\", r_version)) { options(repos = \"https://packagemanager.posit.co/cran/2021-05-03/\") } else if (grepl(\"^4.2\", r_version)) { options(repos = \"https://packagemanager.posit.co/cran/2022-01-03/\") } else if (grepl(\"^4.3\", r_version)) { options(repos = \"https://packagemanager.posit.co/cran/2023-04-20/\") } else { options(repos = \"https://cran.rstudio.com\") } if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_deps(dependencies = TRUE) remotes::install_github(\"pharmaverse/pharmaversesdtm\", ref = \"devel\") remotes::install_github(\"pharmaverse/admiraldev\", ref = \"devel\") rcmdcheck::rcmdcheck()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"package-dependencies","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Package Dependencies","title":"R CMD Issues","text":"Add pkg Imports Suggests field DESCRIPTION file. general, dependencies listed Imports field. However, package used inside vignettes unit tests listed Suggests admiral functions work without “soft” dependencies installed.","code":"> checking package dependencies ... ERROR Namespace dependency not required: 'pkg'"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"global-variables","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Global Variables","title":"R CMD Issues","text":"Add some_var list “global” variables R/globals.R.","code":"❯ checking R code for possible problems ... NOTE function_xyz: no visible binding for global variable 'some_var'"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"undocumented-function-parameter","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Undocumented Function Parameter","title":"R CMD Issues","text":"Add @param some_param section header function_xyz() run devtools::document() afterwards.","code":"❯ checking Rd \\usage sections ... WARNING Undocumented arguments in documentation object 'function_xyz' 'some_param'"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/rcmd_issues.html","id":"outdated-documentation","dir":"Articles","previous_headings":"Common R CMD Check Issues","what":"Outdated Documentation","title":"R CMD Issues","text":"name parameter changed function code yet header. Change @param old_param_name @param new_param_name run devtools::document(). reading recommend R-pkg manual r-cmd chapter","code":"❯ checking for code/documentation mismatches ... WARNING Codoc mismatches from documentation object 'function_xyz': ... Argument names in code not in docs: new_param_name Argument names in docs not in code: old_param_name Mismatches in argument names: Position: 6 Code: new_param_name Docs: old_param_name"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Release Strategy","text":"article explains package releases admiral across package extensions. includes details around planned/scheduled releases, well hotfixes.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"release-schedule","dir":"Articles","previous_headings":"","what":"Release Schedule","title":"Release Strategy","text":"release schedule maintained homepage.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"planning-releases","dir":"Articles","previous_headings":"","what":"Planning Releases","title":"Release Strategy","text":"past, whenever started looking towards future release, create new release issue label GitHub form release Q4-2022 prioritize issues. However, backlog minimal every issue considered Priority Issue. issue Priority, sent back Discussion Tab formed Priority issue. share advance users high level summary expected package updates via community meetings, especially anticipated breaking changes.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"package-release-process","dir":"Articles","previous_headings":"","what":"Package Release Process","title":"Release Strategy","text":"following important steps planned release hot fix release described. Depending package may helpful use usethis::use_release_issue() package-specific release_bullets() function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"planned-release","dir":"Articles","previous_headings":"Package Release Process","what":"Planned Release","title":"Release Strategy","text":"package release done following steps: Create release version: Create new feature branch main. Call usethis::use_version() update Versions: field DESCRIPTION file update NEWS.md (replace “(development version)” version released) Create PR main merge . title PR must contain “[skip vbump]”. Otherwise, vbump workflow sets version development version CRAN reject submission. Bundle main (devtools::build(manual = TRUE)) send CRAN. See chapter R Packages details. CRAN asks modifications, repeat steps 1-2 necessary. package accepted available CRAN, use release button GitHub “release” package onto GitHub, select main branch target, use tag form vX.Y.Z, e.g., v1.1.2 (see past admiral releases reference Releasing Github section details). releases onto Github archives version code within main branch, attaches News/Changelog file, bundles code tar.gz file makes validation report via GitHub action validation insightsengineering/validatoR. also builds website released version stores new vx.y.z folder gh-pages branch. Merge main patch prepared case needed hotfix. Create next development version: Create new feature branch main. Call usethis::use_dev_version() update NEWS.md (adds new section # admiral (development version)) update version DESCRIPTION file development version. Create PR main merge .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"hot-fix-release","dir":"Articles","previous_headings":"Package Release Process","what":"Hot Fix Release","title":"Release Strategy","text":"Rarely, may need release hot fix immediately address bug. majority cases, -cycle release can made directly main branch, bug fixes new features released earlier planned, thus avoiding patch branch release. hot fix release done following steps: Identify bugs need fixed hot fix release label “hotfix” label. Branches addressing bugs Pull Requests merged single patch branch main branch, patch branch created recent release package. , run following git commands: git checkout -b patch vX.Y.Z git push -u origin patch need use development versions. .e., first pull request set version DESCRIPTION version released corresponding heading added NEWS.md. naming branch follow naming conventions guide. PRs hot fix merged (patch), bundle patch (devtools::build(manual = TRUE)) send CRAN. See chapter R Packages details. CRAN asks modifications, repeat steps 1-4 necessary. package accepted available CRAN, , use release button GitHub “release” package onto GitHub, select patch branch target, use tag form vX.Y.Z, e.g., v1.1.2 (see past admiral releases reference Releasing Github section details). releases onto Github archives version code within patch branch, attaches News/Changelog file, bundles code tar.gz file makes validation report via GitHub action validation insightsengineering/validatoR. also builds website released version stores new vx.y.z folder gh-pages branch. hot fixes merged main branch additional Pull Request. Merging PR update version DESCRIPTION file development version. Create next development version: Create new feature branch main. Update NEWS.md (add new section # admiral (development version)) Create PR main merge .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"releasing-to-github","dir":"Articles","previous_headings":"","what":"Releasing to Github","title":"Release Strategy","text":"Releases section main repo, select Draft New Release. Proceed creating appropriate release tag header, denoted vX.X.X admiral X.X.X respectively, release: Copy contents NEWS.md section release, paste release notes section: upload box says, “Attach binaries dropping selecting ” upload appropriate admiral_X.X.X.tar.gz file available download CRAN website. Click Publish Release ’re done! NB: Occasionally, might need delete tag something done error. Deleting tag can done GitHub must done terminal. However, easy!! Just use: git push --delete origin tagname","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"release-tracking","dir":"Articles","previous_headings":"","what":"Release Tracking","title":"Release Strategy","text":"new package release submitted CRAN awaiting go-live, can track status searching within dashboard.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/release_strategy.html","id":"communications","dir":"Articles","previous_headings":"","what":"Communications","title":"Release Strategy","text":"release, raise awareness via Slack channel LinkedIn.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"unit-tests-become-a-safety-net-for-developers","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Unit Tests Become a Safety Net for Developers","title":"Unit Test Guidance","text":"comprehensive suite unit tests can act safety net developers. frequently running tests, can assure recent modifications code haven’t broken anything. words, unit tests help prevent regressions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"unit-tests-can-contribute-to-higher-code-quality","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Unit Tests Can Contribute to Higher Code Quality","title":"Unit Test Guidance","text":"Since unit tests act safety net, developers become confident changing code. can refactor code without fear breaking things, driving general quality code base .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"unit-tests-can-contribute-to-better-application-architecture","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Unit Tests Can Contribute to Better Application Architecture","title":"Unit Test Guidance","text":"can add unit tests easily code base, ’s usually good sign regarding quality app’s architecture. , drive write testable code can incentive better architecture.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"detects-code-smells-in-your-codebase","dir":"Articles","previous_headings":"Why Write Unit Tests?","what":"Detects Code Smells in your Codebase","title":"Unit Test Guidance","text":"ease adding unit tests code base good sign, opposite also true. hard time creating unit tests given piece code might sign code smells code—e.g. functions complex.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-fast","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Tests Should Be Fast","title":"Unit Test Guidance","text":"’re slow, developers won’t run often . defeats whole purpose suite unit tests first place, boost developers’ confidence make changes code. tests can’t work safety net ’re run often.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-simple","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Tests Should Be Simple","title":"Unit Test Guidance","text":"several techniques can apply high degree confidence correctness tests. One keep tests low cyclomatic complexity. Cyclomatic complexity code metric indicates number possible execution paths given method can follow. piece code lower complexity easier understand maintain, means developers less likely introduce bugs working . can measure cyclomatic complexity tests (using, instance, linter tool) best keep low.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"test-shouldnt-duplicate-implementation-logic","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Test Shouldn’t Duplicate Implementation Logic","title":"Unit Test Guidance","text":"person wrote test implementation, ’s possible made errors places. Since tests mirror implementation, might still pass, implementation wrong, tests might fool thinking otherwise. Resist urge make tests fancy, keep simple, testing suite better .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-readable","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Tests Should Be Readable","title":"Unit Test Guidance","text":"best practice overlaps little bit one keeping tests simple. tests hard read, developers likely misunderstand introduce bugs. Test cases used form documentation, obviously need readable.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"running-unit-tests-part-of-the-build-process","dir":"Articles","previous_headings":"Writing Good Unit Tests","what":"Running Unit Tests Part of the Build Process","title":"Unit Test Guidance","text":"Automate whole process running unit tests taking action fail. build process execute unit tests mark build broken tests fail.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"plan-your-unit-tests","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Plan your Unit Tests","title":"Unit Test Guidance","text":"Start considering derivation rule testing possible arguments/flexibilities function code. plan scenarios test. can either involve generating different input test cases feeding different calls function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"test-coverage","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Test coverage","title":"Unit Test Guidance","text":"Unit tests cover functionality function. another function g() called within function f(), unit tests f() test functionality g(). tested unit tests g(), .e. unit tests added lowest level.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"tests-should-be-robust-to-cover-realistic-data-scenarios","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Tests Should be Robust to Cover Realistic Data Scenarios","title":"Unit Test Guidance","text":"generating input test cases, can helpful consider regular cases (expected common data scenarios), boundary cases (data points close equal), special cases (uncommon valid data scenarios, e.g. missing special characters). Although never cover every single eventuality possible input data (reliability testing method ever gives 100% certainty), need give confidence code robust enough work across data scenarios.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"testing-should-cover-possible-arguments","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Testing Should Cover Possible Arguments","title":"Unit Test Guidance","text":"different calls function, consider user might apply function test variety possible calls, whilst still remembering tips tests fast simple. needed cases complexity level flexibility function justifies , e.g. see test script: https://github.com/pharmaverse/admiral/blob/main/tests/testthat/test-derive_var_extreme_flag.R.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"exported-functions","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Exported Functions","title":"Unit Test Guidance","text":"Don’t forget add unit test exported function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"snapshot-testing","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Snapshot Testing","title":"Unit Test Guidance","text":"Standard unit tests always convenient record expected behavior code. challenges include: Output large, making painful define reference output, bloating size test file making hard navigate. Text output includes many characters like quotes newlines require special handling string. Binary formats like plots images, difficult describe code: .e. plot looks right, error message useful human, print method uses color effectively. situations, testthat provides alternative mechanism: snapshot tests. Snapshot tests record results separate human readable file records results, including output, messages, warnings, errors. Review {testthat} snapshot vignette details.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"set-up-the-test-script","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Set up the Test Script","title":"Unit Test Guidance","text":"Within tests/testthat folder project, add script naming convention test-.R., unit test script can created console also, follows: testing framework used testthat following format : example, testing function called my_new_func contained script all_funcs.R console use: Open newly created file test-all_funcs.R use following format: Note: comparing datasets admiral use function expect_dfs_equal(). input expected output unit tests must follow following rules: Input output simple possible. Values hard-coded whenever possible. values need derived, unit tested functions can used. contrast Programming Strategy documentation function examples, test files include library(pkg_name) calls. dataset needs created testing purposes, done using function tribble() tibble package following command dplyr::tribble(). Furthermore, functions need called, also done using pkg_name::fun()notation. Make sure align columns well. ensures quick code readability. Ensure give meaningful explanation test testthat call, compiled package validation report. name function test ID included title also help traceability. comments ending ---- create entries TOC RStudio.","code":"usethis::use_test(\"\") ## Test 1: ---- test_that(\" Test 1: \", { input <- dplyr::tribble( ~inputvar1, ~inputvar2, ... ... ) expected_output <- mutate(input, outputvar = c()) expect_dfs_equal((input), expected_output) }) usethis::use_test(\"all_funcs\") # my_new_func ---- ## Test 1: ---- test_that(\"my_new_func Test 1: \", { input <- dplyr::tribble( ~inputvar1, ~inputvar2, ... ... ) expected_output <- mutate(input, outputvar = c()) expect_dfs_equal((input), expected_output) })"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"addin-pharmaverse4devsformat_test_that_file","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Addin pharmaverse4devs::format_test_that_file()","title":"Unit Test Guidance","text":"ease burden developers writing adding tests developed Addin formatting test_that test files according admiral programming standards. Addin add update comments well number re-numbers tests. access Addin, sure install {pharmaverse4devs} Github. install latest development version package directly GitHub use following code: use Addin button select “Format test_that test file” seen image. sure test-file open selected calling Addin. Addin perform following: Updates adds number tests comments test_that() call Updates comments based description provided test_that() call Updates function name test_that() call. function name extracted last # ---- comment test_that() call. test file tests one function, comments added first test function. test files tests single function , comments can omitted. case addin determines function name file name stripping “test-” prefix “.R” suffix. writing new unit tests, just provide description test_that() call necessary function name # ---- comment: Call addin get: tested unit test program, can run unit tests console, follows. running just tests current file call","code":"if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_github(\"pharmaverse/pharmaverse4devs\") # derive_vars_merged ---- test_that( \"works if it merges all variables\", { actual <- derive_vars_merged(advs, dataset_add = adsl, by_vars = exprs(STUDYID, USUBJID) ) # convert_dtm_to_dtc ---- test_that(\"works if dtm is in correct format\", { expect_equal( convert_dtm_to_dtc(as.POSIXct(\"2022-04-05 15:34:07 UTC\")), \"2022-04-05T15:34:07\" ) }) test_that(\"Error is thrown if dtm is not in correct format\", { expect_error( convert_dtm_to_dtc(\"2022-04-05T15:26:14\"), \"lubridate::is.instant(dtm) is not TRUE\", fixed = TRUE ) }) # derive_vars_merged ---- ## Test 1: derive_vars_merged ---- test_that( \"derive_vars_merged Test 1: it merges all variables\", { actual <- derive_vars_merged(advs, dataset_add = adsl, by_vars = exprs(STUDYID, USUBJID) ) # convert_dtm_to_dtc ---- ## Test 2: works if dtm is in correct format ---- test_that(\"convert_dtm_to_dtc Test 2: works if dtm is in correct format\", { expect_equal( convert_dtm_to_dtc(as.POSIXct(\"2022-04-05 15:34:07 UTC\")), \"2022-04-05T15:34:07\" ) }) ## Test 3: Error is thrown if dtm is not in correct format ---- test_that(\"convert_dtm_to_dtc Test 3: Error is thrown if dtm is not in correct format\", { expect_error( convert_dtm_to_dtc(\"2022-04-05T15:26:14\"), \"lubridate::is.instant(dtm) is not TRUE\", fixed = TRUE ) }) devtools::test() devtools::test_file()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/unit_test_guidance.html","id":"automation-of-unit-tests","dir":"Articles","previous_headings":"Writing Unit Tests in {admiral}","what":"Automation of Unit Tests","title":"Unit Test Guidance","text":"user actions pull request {admiral} GitHub repo, unit tests automatically run pull request denied unit tests fail.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Writing Vignettes","text":"guidance ensures consistency across vignettes admiral package terms content, structure code execution. general rule, vignette workflow defined r-pkgs.org followed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"metadata","dir":"Articles","previous_headings":"","what":"Metadata","title":"Writing Vignettes","text":"vignette admiral start following metadata. vignette meaningful.","code":"--- title: \"\" output: rmarkdown::html_vignette: vignette: > %\\VignetteIndexEntry{} %\\VignetteEngine{knitr::rmarkdown} ---"},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"default-options","dir":"Articles","previous_headings":"Markdown","what":"Default Options","title":"Writing Vignettes","text":"chunks used within vignette, following options set metadata ensure chunks rendered consistently across vignettes.","code":"```{r setup, include=FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = \"#>\" ) ```"},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"table-of-contents","dir":"Articles","previous_headings":"Markdown > Format Sections","what":"Table of Contents","title":"Writing Vignettes","text":"Headings must title case start Heading 1: first section gives brief introduction vignette. last sub-section introduction describe packages required run admiral functions. admiral package described first. warning=FALSE message=FALSE options prevent usual messages: Attaching package: ‘xxxx’following objects masked ‘package:yyyyy’ fun1, fun2","code":"# Heading 1 This is the description of my first section. ## Heading 1.1 This is the description of my first sub-section within my first section. ## Heading 1.2 This is the description of my second sub-section within my first section. # Introduction This is the introduction of my vignette. ## Required Packages ```{r, warning=FALSE, message=FALSE} library(admiral) # ```"},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"general-conventions","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"General Conventions","title":"Writing Vignettes","text":"new vignette must added _pkgdown.yml file relevant section. variable name, dataset name, function, argument name must quoted backticks: e.g. Functions must also end (). Variables datasets name expected uppercase. codes must described, executed output result displayed code executed. Use: output created must clearly show function derived. least show variables/records used input function derived variables/records. dataset must displayed, formatted using dataset_vignette() function displayed consistently across vignettes.E.g. Description execution code used derive variable/record Output dataset formatted using dataset_vignette()… Note: call get formatted dataset : Displaying many big datasets vignette, may require long time load page may cause messages browser page responsive. case number displayed observations restricted either restricting source datasets beginning vignette call dataset_vignette() calls affected.","code":"The `date` parameter of the `derive_my_var()` function expects a date variable, e.g., `ADT`. ```{r} # ``` vs1 <- vs %>% derive_vars_dt( new_vars_prefix = \"A\", dtc = VSDTC, date_imputation = \"first\" ) ``` r dataset_vignette( vs1, display_vars = exprs(USUBJID, VSTESTCD, VISIT, VSDTC, ADT), filter = VSTESTCD == \"WEIGHT\" ) ```"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"using-footnotes","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Using Footnotes","title":"Writing Vignettes","text":"Footnotes can useful add context without adding clutter primary subject matter vignette written. use footnotes, add caret identifier inside brackets e.g. ([^1]). identifiers can numbers words, can’t contain spaces tabs. following markdown text render follows: example 1","code":"Here is an example [^1] [^1]: Cool note about the example."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"conventions-for-adam-workflow","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Conventions for ADaM Workflow","title":"Writing Vignettes","text":"vignettes describing ADaM workflow, second section summarize programming workflow. first sub-section within workflow always describe data read demonstrate use admiral functions, sub-section within programming workflow tagged (e.g. [Step1] (#step)), user can go relevant section programming workflow (addition Table contents). Don’t use tag number use meaningful name (e.g. use (#link1), use (#this_action)) last section link template script. ADSL variables ADSL variables required derivation merged SDTM dataset first derivation. ADSL variables added -variables derivations add observations. ensures ADSL variables populated new observations. adsl_vars variable created beginning script added by_vars parameter derivations add observations. ADSL variables final dataset required derivation merged dataset last derivation.","code":"# Programming Workflow * [Read in Data](#readdata) * [Derive/Impute End and Start Analysis Date/time and Relative Day](#datetime) * ... * [Assign `ASEQ`](#aseq) ## Read in Data {#readdata} ## Derive/Impute End and Start Analysis Date/time and Relative Day {#datetime} ## ... ## Assign `ASEQ` {#aseq} # Another Section # Example Script ADaM | Sample Code ---- | -------------- ADxx | [ad_adxx.R](https://github.com/pharmaverse/admiral/blob/main/inst/templates/ad_adxx.R){target=\"_blank\"}"},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ben Straub. Author, maintainer. Stefan Bundfuss. Author. Jeffrey Dickinson. Author. Ross Farrugia. Author. Fanny Gautier. Author. Edoardo Mancini. Author. Sadchla Mascary. Author. Gordon Miller. Author. Daniel Sjoberg. Author. Stefan Thoma. Author. Kangjie Zhang. Author. Zelos Zhu. Author. F. Hoffmann-La Roche AG. Copyright holder, funder. GlaxoSmithKline LLC. Copyright holder, funder.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Straub B, Bundfuss S, Dickinson J, Farrugia R, Gautier F, Mancini E, Mascary S, Miller G, Sjoberg D, Thoma S, Zhang K, Zhu Z (2025). admiraldev: Utility Functions Development Tools Admiral Package Family. R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/, https://pharmaverse.github.io/admiraldev/.","code":"@Manual{, title = {admiraldev: Utility Functions and Development Tools for the Admiral Package Family}, author = {Ben Straub and Stefan Bundfuss and Jeffrey Dickinson and Ross Farrugia and Fanny Gautier and Edoardo Mancini and Sadchla Mascary and Gordon Miller and Daniel Sjoberg and Stefan Thoma and Kangjie Zhang and Zelos Zhu}, year = {2025}, note = {R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/}, url = {https://pharmaverse.github.io/admiraldev/}, }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"admiraldev-","dir":"","previous_headings":"","what":"Utility Functions and Development Tools for the Admiral Package Family","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Utility Functions Development Tools Admiral Package Family","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"purpose","dir":"","previous_headings":"","what":"Purpose","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Functions, tools documentation developing core admiral extension package functions. functions admiraldev around testing inputs going functions. also additional quality life functions/Addins assist developers admiral admiral extension packages, functions help rendering documentation, Developer Guides developing function using GitHub, GitHub Actions. NOTE: package intended standalone use rather central dependency admiral extension packages","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"package available CRAN can installed running install.packages(\"admiraldev\"). install latest development version package directly GitHub use following code:","code":"if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_github(\"pharmaverse/admiraldev\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"release-schedule","dir":"","previous_headings":"","what":"Release Schedule","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"admiraldev released CRAN time official release admiral. can find release schedule admiral packages .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Along authors contributors, thanks following people work package: Ania Golab, Samia Kabi, Pooja Kumari, Syed Mubasheer, Thomas Neitmann Ondrej Slama.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"Add suffix variables list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"add_suffix_to_vars(order, vars, suffix)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"order List expressions Permitted Values: list variables desc() function calls created exprs(), e.g., exprs(ADT, desc(AVAL)) vars Variables change Permitted Values: list variables created exprs() suffix Suffix Permitted Values: character scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"list expression element suffix (suffix) added every symbol specified vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) add_suffix_to_vars(exprs(ADT, desc(AVAL), AVALC), vars = exprs(AVAL), suffix = \".join\") #> [[1]] #> ADT #> #> [[2]] #> desc(AVAL.join) #> #> [[3]] #> AVALC #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":null,"dir":"Reference","previous_headings":"","what":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Utility functions check data, variables conditions functions used 'admiral' 'admiral' extension packages. Additional utility helper functions assist developers maintaining documentation, testing general upkeep 'admiral' 'admiral' extension packages.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Maintainer: Ben Straub ben.x.straub@gsk.com Authors: Stefan Bundfuss (ORCID) Jeffrey Dickinson Ross Farrugia Fanny Gautier Edoardo Mancini (ORCID) Sadchla Mascary Gordon Miller Daniel Sjoberg (ORCID) Stefan Thoma (ORCID) Kangjie Zhang Zelos Zhu contributors: F. Hoffmann-La Roche AG [copyright holder, funder] GlaxoSmithKline LLC [copyright holder, funder]","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract Argument Name from an Expression — arg_name","title":"Extract Argument Name from an Expression — arg_name","text":"Extract Argument Name Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract Argument Name from an Expression — arg_name","text":"","code":"arg_name(expr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract Argument Name from an Expression — arg_name","text":"expr expression created inside function using substitute()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract Argument Name from an Expression — arg_name","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Atomic Vector? — assert_atomic_vector","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"Checks argument atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"assert_atomic_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_atomic_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"function throws error arg atomic vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"example_fun <- function(x) { assert_atomic_vector(x) } example_fun(1:10) try(example_fun(list(1, 2))) #> Error in example_fun(list(1, 2)) : #> Argument `x` must be an atomic vector, but is a list."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Scalar (String)? — assert_character_scalar","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"Checks argument character scalar (optionally) whether matches one provided values.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"assert_character_scalar( arg, values = NULL, case_sensitive = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"arg function argument checked values character vector valid values arg. Values converted lower case vector case_sensitive = FALSE used. case_sensitive argument handled case-sensitive? set FALSE, argument converted lower case checking permitted values returning argument. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"function throws error arg character vector arg character vector length > 1 value one values specified. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"example_fun <- function(msg_type) { assert_character_scalar(msg_type, values = c(\"warning\", \"error\")) } example_fun(\"warning\") try(example_fun(\"message\")) #> Error in example_fun(\"message\") : #> Argument `msg_type` must be equal to one of \"warning\" or \"error\". try(example_fun(TRUE)) #> Error in example_fun(TRUE) : #> Argument `msg_type` must be a scalar of class , but is #> `TRUE`. # handling arguments case-insensitive example_fun2 <- function(msg_type) { msg_type <- assert_character_scalar( msg_type, values = c(\"warning\", \"error\"), case_sensitive = FALSE ) if (msg_type == \"warning\") { print(\"A warning was requested.\") } } example_fun2(\"Warning\") #> [1] \"A warning was requested.\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Vector? — assert_character_vector","title":"Is an Argument a Character Vector? — assert_character_vector","text":"Checks argument character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"assert_character_vector( arg, values = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Vector? — assert_character_vector","text":"arg function argument checked values character vector valid values arg named set TRUE, error issued elements vector named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Vector? — assert_character_vector","text":"function throws error arg character vector element included list valid values. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"example_fun <- function(chr) { assert_character_vector(chr) } example_fun(letters) try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `chr` must be , but is an integer vector. example_fun2 <- function(chr) { assert_character_vector(chr, named = TRUE) } try(example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\"))) #> Error in example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\")) : #> All elements of `chr` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Data Frame? — assert_data_frame","title":"Is an Argument a Data Frame? — assert_data_frame","text":"Checks argument data frame (optionally) whether contains set required variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"assert_data_frame( arg, required_vars = NULL, check_is_grouped = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_data_frame\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Data Frame? — assert_data_frame","text":"arg function argument checked required_vars list variables created using exprs() check_is_grouped Throw error dataset grouped? Defaults TRUE. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Data Frame? — assert_data_frame","text":"function throws error arg data frame arg data frame misses variable specified required_vars. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"library(dplyr) library(rlang) dm <- tribble( ~STUDYID, ~USUBJID, \"XYZ\", \"1\", \"XYZ\", \"2\" ) example_fun <- function(dataset) { assert_data_frame(dataset, required_vars = exprs(STUDYID, USUBJID)) } example_fun(dm) try(example_fun(select(dm, -STUDYID))) #> Error in example_fun(select(dm, -STUDYID)) : #> Required variable `STUDYID` is missing in `dataset` try(example_fun(\"Not a dataset\")) #> Error in example_fun(\"Not a dataset\") : #> Argument `dataset` must be class , but is a string. try(example_fun(group_by(dm, USUBJID))) #> Error in example_fun(group_by(dm, USUBJID)) : #> Argument `dataset` must not be a grouped dataset, please `ungroup()` it."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"Checks variable dataset date datetime variable","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"assert_date_var( dataset, var, dataset_name = rlang::caller_arg(dataset), var_name = rlang::caller_arg(var), message = NULL, class = \"assert_date_var\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"dataset dataset variable expected var variable check dataset_name name dataset. argument specified, specified name displayed error message. var_name name variable. argument specified, specified name displayed error message. message (string) string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"var_name\" \"dataset_name\", can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"function throws error var date datetime variable dataset returns input invisibly otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"library(lubridate) #> #> Attaching package: ‘lubridate’ #> The following objects are masked from ‘package:base’: #> #> date, intersect, setdiff, union library(dplyr) library(rlang) example_fun <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var(dataset = dataset, var = !!var) } my_data <- tribble( ~USUBJID, ~ADT, \"1\", ymd(\"2020-12-06\"), \"2\", ymd(\"\") ) example_fun( dataset = my_data, var = ADT ) try(example_fun( dataset = my_data, var = USUBJID )) #> Error in example_fun(dataset = my_data, var = USUBJID) : #> Column \"USUBJID\" in dataset `dataset` must be a date or datetime, but is #> a character vector. example_fun2 <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var( dataset = dataset, var = !!var, dataset_name = \"your_data\", var_name = \"your_var\" ) } try(example_fun2( dataset = my_data, var = USUBJID )) #> Error in example_fun2(dataset = my_data, var = USUBJID) : #> Column \"your_var\" in dataset `your_data` must be a date or datetime, but #> is a character vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object a date or datetime vector? — assert_date_vector","title":"Is an object a date or datetime vector? — assert_date_vector","text":"Check object/vector date datetime variable without needing dataset input","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"assert_date_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_date_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object a date or datetime vector? — assert_date_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL function assert_date_vector exits early throw error. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an object a date or datetime vector? — assert_date_vector","text":"function returns error arg missing, date datetime variable otherwise returns invisible output.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"example_fun <- function(arg) { assert_date_vector(arg) } example_fun( as.Date(\"2022-01-30\", tz = \"UTC\") ) try(example_fun(\"1993-07-14\")) #> Error in example_fun(\"1993-07-14\") : #> Argument `arg` must be a date or datetime, but is a string."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is an Expression — assert_expr","title":"Assert Argument is an Expression — assert_expr","text":"Assert Argument Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is an Expression — assert_expr","text":"","code":"assert_expr( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_expr\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is an Expression — assert_expr","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is an Expression — assert_expr","text":"function throws error arg expression, .e. either symbol call, returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Expressions? — assert_expr_list","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"Checks argument list expressions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"assert_expr_list( arg, required_elements = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_expr_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"arg function argument checked required_elements character vector names must present arg named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"function throws error arg list expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"library(rlang) example_fun <- function(vars) { assert_expr_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\")))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\"))) : #> All elements of `vars` must be an expression. #> ℹ `vars[[3]]` = `list(\"a\")` is of type , and `vars[[4]]` = `list(\"a\")` is #> of type "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Filter Condition? — assert_filter_cond","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Argument Filter Condition?","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"assert_filter_cond( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_filter_cond\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"arg Quosure - filtering condition. optional Logical - argument optional? Defaults FALSE. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Performs necessary checks returns arg pass. Otherwise throws informative error.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Check arg suitable filtering condition used functions like subset dplyr::filter.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~STUDYID, ~USUBJID, ~AGE, \"DM\", \"STUDY X\", \"01-701-1015\", 64, \"DM\", \"STUDY X\", \"01-701-1016\", 65, ) # typical usage in a function as an argument check example_fun <- function(dat, x) { x <- assert_filter_cond(enexpr(x), arg_name = \"x\") filter(dat, !!x) } example_fun(dm, AGE == 64) #> # A tibble: 1 × 4 #> DOMAIN STUDYID USUBJID AGE #> #> 1 DM STUDY X 01-701-1015 64 try(assert_filter_cond(mtcars)) #> Error in eval(expr, envir) : #> Argument `mtcars` must be a filter condition, but is a data frame"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Is Argument a Function? — assert_function","title":"Is Argument a Function? — assert_function","text":"Checks argument function expected arguments provided function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is Argument a Function? — assert_function","text":"","code":"assert_function( arg, params = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_function\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is Argument a Function? — assert_function","text":"arg function function checked params character vector character vector expected argument names aforementioned function arg. ellipsis, ..., included function formals function arg, argument, params ignored, accepting values character vector. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is Argument a Function? — assert_function","text":"function throws error argument function function provide arguments specified params argument (assuming ellipsis function formals)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is Argument a Function? — assert_function","text":"","code":"example_fun <- function(fun) { assert_function(fun, params = c(\"x\")) } example_fun(mean) try(example_fun(1)) #> Error in example_fun(1) : #> Argument `fun` must be a function, but is a number. try(example_fun(sum)) #> Error in example_fun(sum) : #> \"x\" is not an argument of the function specified for `fun`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Integer Scalar? — assert_integer_scalar","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"Checks argument integer scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"assert_integer_scalar( arg, subset = \"none\", optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_integer_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"arg function argument checked subset subset integers arg part . one \"none\" (default), \"positive\", \"non-negative\" \"negative\". optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"function throws error arg integer belonging specified subset. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"example_fun <- function(num1, num2) { assert_integer_scalar(num1, subset = \"positive\") assert_integer_scalar(num2, subset = \"negative\") } example_fun(1, -9) try(example_fun(1.5, -9)) #> Error in example_fun(1.5, -9) : #> Argument `num1` must be a positive integer scalar. try(example_fun(2, 0)) #> Error in example_fun(2, 0) : #> Argument `num2` must be a negative integer scalar. try(example_fun(\"2\", 0)) #> Error in example_fun(\"2\", 0) : #> Argument `num1` must be a positive integer scalar."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"Checks elements list named lists/classes fulfill certain condition. , error issued elements list fulfilling condition listed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"assert_list_element( list, element, condition, message_text, arg_name = rlang::caller_arg(list), message = NULL, class = \"assert_list_element\", call = parent.frame(), ... )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"list list checked list named lists classes expected. element name element lists/classes character scalar expected. condition Condition fulfilled condition evaluated element list. element lists/classes can referred name, e.g., censor == 0 check censor field class. message_text Text displayed error message listing values meet condition. text describe condition fulfilled, e.g., \"Error {arg_name}: censor values must zero.\". message argument specified, text displayed message_text ignored. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages. ... Objects required evaluate condition message text condition message text contains objects apart element, passed function. See second example .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"error condition met. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"death <- list( dataset_name = \"adsl\", date = \"DTHDT\", censor = 0 ) lstalv <- list( dataset_name = \"adsl\", date = \"LSTALVDT\", censor = 1 ) events <- list(death, lstalv) try(assert_list_element( list = events, element = \"censor\", condition = censor == 0, message_text = \"For events the censor values must be zero.\" )) #> Error in eval(expr, envir) : #> For events the censor values must be zero. #> ℹ But, `events[[2]]$censor = 1` try(assert_list_element( list = events, element = \"dataset_name\", condition = dataset_name %in% c(\"adrs\", \"adae\"), valid_datasets = c(\"adrs\", \"adae\"), message_text = paste( \"The dataset name must be one of the following: {.val {valid_datasets}}\" ) )) #> Error in eval(expr, envir) : #> The dataset name must be one of the following: \"adrs\" and \"adae\" #> ℹ But, `events[[1]]$dataset_name = adsl`, and `events[[2]]$dataset_name = adsl`"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"Checks argument list objects inheriting S3 class type specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"assert_list_of( arg, cls, named = FALSE, optional = TRUE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_list_of\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"arg function argument checked cls S3 class type check named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"function throws error arg list arg list elements objects inheriting class type class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"example_fun <- function(list) { assert_list_of(list, \"data.frame\") } example_fun(list(mtcars, iris)) try(example_fun(list(letters, 1:10))) #> Error in example_fun(list(letters, 1:10)) : #> Each element of the list in argument `list` must be class/type #> . #> ℹ But, element 1 is a character vector, and element 2 is an integer vector try(example_fun(c(TRUE, FALSE))) #> Error in example_fun(c(TRUE, FALSE)) : #> Argument `list` must be class , but is a logical vector. example_fun2 <- function(list) { assert_list_of(list, \"numeric\", named = TRUE) } try(example_fun2(list(1, 2, 3, d = 4))) #> Error in example_fun2(list(1, 2, 3, d = 4)) : #> All elements of `list` argument must be named. #> ℹ The indices of the unnamed elements are 1, 2, and 3"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"Checks argument logical scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"assert_logical_scalar( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_logical_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown. Otherwise, NULL considered valid value. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"function throws error arg neither TRUE FALSE. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"example_fun <- function(flag) { assert_logical_scalar(flag) } example_fun(FALSE) try(example_fun(NA)) #> Error in example_fun(NA) : #> Argument `flag` must be either TRUE or FALSE, but is `NA`. try(example_fun(c(TRUE, FALSE, FALSE))) #> Error in example_fun(c(TRUE, FALSE, FALSE)) : #> Argument `flag` must be either TRUE or FALSE, but is a logical vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `flag` must be either TRUE or FALSE, but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is a Named List or Vector — assert_named","title":"Assert Argument is a Named List or Vector — assert_named","text":"Assert elements argument named.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"assert_named( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_named\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is a Named List or Vector — assert_named","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is a Named List or Vector — assert_named","text":"function throws error arg named list vector returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"example_fun <- function(varval_list) { assert_named(varval_list) } example_fun(list(var1 = 1, var2 = \"x\")) try(example_fun(list(1, \"x\"))) #> Error in example_fun(list(1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 1 and 2 try(example_fun(list(var = 1, \"x\"))) #> Error in example_fun(list(var = 1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Numeric Vector? — assert_numeric_vector","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"Checks argument numeric vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"assert_numeric_vector( arg, length = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_numeric_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"arg function argument checked length Expected length argument specified set NULL, length accepted. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"function throws error arg numeric vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"example_fun <- function(num) { assert_numeric_vector(num) } example_fun(1:10) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `num` must be a numeric vector, but it is a character vector. example_fun <- function(num) { assert_numeric_vector(num, length = 2) } try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `num` must be a vector of length 2, but has length 10."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":null,"dir":"Reference","previous_headings":"","what":"Is There a One to One Mapping between Variables? — assert_one_to_one","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"Checks one one mapping two lists variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"assert_one_to_one( dataset, vars1, vars2, dataset_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_one_to_one\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"dataset Dataset checked variables specified vars1 vars2 expected. vars1 First list variables vars2 Second list variables dataset_name string indicating label/symbol object checked. Default rlang::caller_arg(dataset). message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"dataset_name\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"error condition meet. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"library(dplyr) library(rlang) df <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 1L ) assert_one_to_one(df, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) df_many <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 3L ) try( assert_one_to_one(df_many, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) ) #> Error in eval(expr, envir) : #> For some values of \"SPECIES\" there is more than one value of \"SPECIESN\" #> ℹ Call `admiral::get_one_to_many_dataset()` to get all one-to-many values. try( assert_one_to_one(df_many, vars1 = exprs(SPECIESN), vars2 = exprs(SPECIES)) ) #> Error in eval(expr, envir) : #> There is more than one value of \"SPECIESN\" for some values of \"SPECIES\" #> ℹ Call `admiral::get_many_to_one_dataset()` to get all many-to-one values."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"Checks parameter (PARAMCD) exist dataset.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"assert_param_does_not_exist( dataset, param, arg_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_param_does_not_exist\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"dataset data.frame param Parameter code check arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"function throws error parameter exists input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_param_does_not_exist(advs, param = \"HR\") try(assert_param_does_not_exist(advs, param = \"WEIGHT\")) #> Error in eval(expr, envir) : #> The parameter code \"WEIGHT\" already exists in dataset `advs`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"Checks argument object inheriting S3 class specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"assert_s3_class( arg, cls, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_s3_class\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"arg function argument checked cls S3 class check optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"function throws error arg object inherit class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"example_fun <- function(obj) { assert_s3_class(obj, \"factor\") } example_fun(as.factor(letters)) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `obj` must be class , but is a character vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `obj` must be class , but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Are All Argument of the Same Type? — assert_same_type","title":"Are All Argument of the Same Type? — assert_same_type","text":"Checks arguments type.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"assert_same_type( ..., .message = c(\"Arguments {.arg {arg_names}} must be the same type.\", i = paste(\"Argument types are\", paste0(\"{.arg \", arg_names, \"} {.cls \", types, \"}\", collapse = \", \"))), .class = \"assert_same_type\", .call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Are All Argument of the Same Type? — assert_same_type","text":"... Arguments checked .message character vector passed cli_abort(message) assertion fails. .class character vector passed cli_abort(class) assertion fails. .call environment passed cli_abort(call) assertion fails.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Are All Argument of the Same Type? — assert_same_type","text":"function throws error arguments type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"example_fun <- function(true_value, false_value, missing_value) { assert_same_type(true_value, false_value, missing_value) } example_fun( true_value = \"Y\", false_value = \"N\", missing_value = NA_character_ ) try(example_fun( true_value = 1, false_value = 0, missing_value = \"missing\" )) #> Error in example_fun(true_value = 1, false_value = 0, missing_value = \"missing\") : #> Arguments `true_value`, `false_value`, and `missing_value` must be the #> same type. #> ℹ Argument types are `true_value` , `false_value` , #> `missing_value` "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Symbol? — assert_symbol","title":"Is an Argument a Symbol? — assert_symbol","text":"Checks argument symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"assert_symbol( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_symbol\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Symbol? — assert_symbol","text":"arg function argument checked. Must symbol. See examples. optional checked argument optional? set FALSE arg NULL error thrown. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Symbol? — assert_symbol","text":"function throws error arg symbol returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~USUBJID, \"DM\", \"01-701-1015\", \"DM\", \"01-701-1016\", ) example_fun <- function(dat, var) { var <- assert_symbol(enexpr(var)) select(dat, !!var) } example_fun(dm, USUBJID) #> # A tibble: 2 × 1 #> USUBJID #> #> 1 01-701-1015 #> 2 01-701-1016 try(example_fun(dm)) #> Error in example_fun(dm) : #> Argument `var` must be a , but is missing. try(example_fun(dm, \"USUBJID\")) #> Error in example_fun(dm, \"USUBJID\") : #> Argument `var` must be a , but is a string. try(example_fun(dm, toupper(PARAMCD))) #> Error in example_fun(dm, toupper(PARAMCD)) : #> Argument `var` must be a , but is a call."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"Checks parameter (PARAMCD) dataset provided expected unit.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"assert_unit( dataset, param, required_unit = NULL, get_unit_expr, arg_name = rlang::caller_arg(required_unit), message = NULL, class = \"assert_unit\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"dataset Dataset checked variable PARAMCD used get_unit_expr expected. param Parameter code parameter check required_unit Expected unit(s) argument set NULL, checked whether unit unique within parameter. Permitted Values: character vector NULL get_unit_expr Expression used provide unit param arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"function throws error one non-missing unit dataset unit variable differs expected unit observation parameter input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_unit(advs, param = \"WEIGHT\", required_unit = \"kg\", get_unit_expr = VSSTRESU) try( assert_unit( advs, param = \"WEIGHT\", required_unit = c(\"g\", \"mg\"), get_unit_expr = VSSTRESU ) ) #> Error in eval(expr, envir) : #> It is expected that \"WEIGHT\" has unit of \"g\" or \"mg\". In the input #> dataset the unit is \"kg\". # Checking uniqueness of unit only advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85700, \"g\", \"WEIGHT\", 85700 ) try( assert_unit(advs, param = \"WEIGHT\", get_unit_expr = VSSTRESU) ) #> Error in eval(expr, envir) : #> Multiple units \"kg\" and \"g\" found for \"WEIGHT\". Please review and update #> the units."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Variables? — assert_vars","title":"Is an Argument a List of Variables? — assert_vars","text":"Checks argument valid list symbols (e.g., created exprs())","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"assert_vars( arg, expect_names = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_vars\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Variables? — assert_vars","text":"arg function argument checked expect_names argument set TRUE, checked variables named, e.g., exprs(APERSDT = APxxSDT, APEREDT = APxxEDT). optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Variables? — assert_vars","text":"function throws error arg list symbols (e.g., created exprs() returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(by_vars) { assert_vars(by_vars) } example_fun(exprs(USUBJID, PARAMCD)) try(example_fun(quos(USUBJID, PARAMCD))) #> Error in example_fun(quos(USUBJID, PARAMCD)) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 1 is a object, and element 2 is a object try(example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\"))) #> Error in example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\")) : #> Argument `by_vars` must be class , but is a character vector. try(example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL)))) #> Error in example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL))) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 2 is a call, and element 3 is a call example_fun_name <- function(by_vars) { assert_vars(by_vars, expect_names = TRUE) } example_fun_name(exprs(APERSDT = APxxSDT, APEREDT = APxxEDT)) try(example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT))) #> Error in example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT)) : #> All elements of `by_vars` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Variable-Value List? — assert_varval_list","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"Checks argument list expressions expressions variable-value pairs. value can symbol, string, numeric, expression, NA.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"assert_varval_list( arg, required_elements = NULL, accept_expr = TRUE, accept_var = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_varval_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"arg function argument checked required_elements character vector names must present arg accept_expr expressions right hand side accepted? accept_var unnamed variable names (e.g. exprs(USUBJID)) right hand side accepted? optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"function throws error arg list variable-value expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(vars) { assert_varval_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ)) : #> Argument `vars` must be a named list of expressions where each element #> is a symbol, character scalar, numeric scalar, an expression, or NA, but is a #> list. #> ℹ To create a list of expressions use `exprs()`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Backquotes — backquote","title":"Wrap a String in Backquotes — backquote","text":"Wrap String Backquotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Backquotes — backquote","text":"","code":"backquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Backquotes — backquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Backquotes — backquote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"check argument contains valid variable(s) created exprs() Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"","code":"contains_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"arg function argument checked","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"TRUE variables valid variable","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"Helper Function Convert Date (Date-time) Objects Characters dtc Format (-DTC type variable)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"","code":"convert_dtm_to_dtc(dtm)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"dtm date date-time","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":null,"dir":"Reference","previous_headings":"","what":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"Output dataset vignette pre-specified admiral format.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"","code":"dataset_vignette(dataset, display_vars = NULL, filter = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"dataset Dataset output vignette display_vars Variables selected demonstrate outcome derivation Permitted Values: list variables Default NULL display_vars NULL, selected variables visible vignette variables hidden. can made visible clicking theChoose columns display button. filter Filter condition specified condition applied dataset displayed. Permitted Values: condition","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"HTML table","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecation with Soft Message — deprecate_inform","title":"Deprecation with Soft Message — deprecate_inform","text":"Wrapper around lifecycle::deprecate_soft() messages users deprecated features functions instead warning.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"deprecate_inform( when, what, with = NULL, details = NULL, id = NULL, env = rlang::caller_env(), user_env = rlang::caller_env(2) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecation with Soft Message — deprecate_inform","text":"string giving version behaviour deprecated. string describing deprecated: Deprecate whole function \"foo()\". Deprecate argument \"foo(arg)\". Partially deprecate argument \"foo(arg = 'must scalar integer')\". Deprecate anything else custom message wrapping (). can optionally supply namespace: \"ns::foo()\", usually needed inferred caller environment. optional string giving recommended replacement deprecated behaviour. takes form . details cases deprecation message can automatically generated . , use details provide hand-written message. details can either single string character vector, converted bulleted list. default, info bullets used. Provide named vectors override. id id deprecation. warning issued id. Defaults generated message, give unique ID message details built programmatically depends inputs, like deprecate multiple functions warn . env, user_env Pair environments define deprecate_*() called (used determine package name) function called deprecating function called (used determine deprecate_soft() message). needed calling deprecate_*() internal helper, case forward env = caller_env() user_env = caller_env(2).","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecation with Soft Message — deprecate_inform","text":"NULL, invisibly.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"# A Phase 1 deprecated function with custom bulleted list: deprecate_inform( when = \"1.0.0\", what = \"foo()\", details = c( x = \"This message will turn into a warning with release of x.y.z\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Double Quotes — dquote","title":"Wrap a String in Double Quotes — dquote","text":"Wrap string double quotes, e.g., displaying character values messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Double Quotes — dquote","text":"","code":"dquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Double Quotes — dquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Double Quotes — dquote","text":"input NULL, text \"NULL\" returned. Otherwise, input double quotes returned.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate Multiple Elements — enumerate","title":"Enumerate Multiple Elements — enumerate","text":"Enumerate multiple elements vector list.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(x, quote_fun = backquote, conjunction = \"and\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate Multiple Elements — enumerate","text":"x vector list quote_fun Quoting function, defaults backquote. set NULL, elements quoted. conjunction Character used message, defaults \"\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate Multiple Elements — enumerate","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(c(\"one\", \"two\", \"three\")) #> Warning: `enumerate()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.val {letters[1:3]}}')` #> [1] \"`one`, `two` and `three`\" enumerate(c(1, 2, 3), quote_fun = NULL) #> [1] \"1, 2 and 3\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"Uses diffdf::diffdf() compares 2 datasets differences. function can thought R-equivalent SAS proc compare useful tool unit testing well.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"expect_dfs_equal(base, compare, keys, ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"base Input dataset compare Comparison dataset keys character vector variables define unique row base compare datasets ... Additional arguments passed onto diffdf::diffdf()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"error base compare match NULL invisibly ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"library(dplyr, warn.conflicts = FALSE) tbl1 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 19, \"F\", \"1003\", 20, \"M\", \"1004\", 18, \"F\" ) tbl2 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 18.9, \"F\", \"1003\", 20, NA ) try(expect_dfs_equal(tbl1, tbl2, keys = \"USUBJID\")) #> Error : Differences found between the objects! #> #> Summary of BASE and COMPARE #> ================================================================== #> PROPERTY BASE COMP #> ------------------------------------------------------------------ #> Name base compare #> Class \"tbl_df, tbl, data.frame\" \"tbl_df, tbl, data.frame\" #> Rows(#) 4 3 #> Columns(#) 3 3 #> ------------------------------------------------------------------ #> #> #> There are rows in BASE that are not in COMPARE !! #> ========= #> USUBJID #> --------- #> 1004 #> --------- #> #> #> Not all Values Compared Equal #> ============================= #> Variable No of Differences #> ----------------------------- #> AGE 1 #> SEX 1 #> ----------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> AGE 1002 19 18.9 #> ---------------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> SEX 1003 M #> ---------------------------------- #> #> tlb3 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1004\", 18, \"F\", \"1003\", 20, \"M\", \"1002\", 19, \"F\", \"1001\", 18, \"M\", ) # Note the sorting order of the keys is not required expect_dfs_equal(tbl1, tlb3, keys = \"USUBJID\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":null,"dir":"Reference","previous_headings":"","what":"Concatenate One or More Expressions — expr_c","title":"Concatenate One or More Expressions — expr_c","text":"Concatenate One Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concatenate One or More Expressions — expr_c","text":"","code":"expr_c(...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concatenate One or More Expressions — expr_c","text":"... One expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concatenate One or More Expressions — expr_c","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract All Symbols from a List of Expressions — extract_vars","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"Extract Symbols List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"extract_vars(x, side = \"lhs\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"x R object side One \"lhs\" (default) \"rhs\" formulas","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"library(rlang) extract_vars(exprs(PARAMCD, (BASE - AVAL) / BASE + 100)) #> [[1]] #> PARAMCD #> #> [[2]] #> BASE #> #> [[3]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1) #> [[1]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1, side = \"rhs\") #> [[1]] #> ARMCD #> #> [[2]] #> AGEGR1 #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Optional Filter — filter_if","title":"Optional Filter — filter_if","text":"Filters input dataset provided expression NULL","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optional Filter — filter_if","text":"","code":"filter_if(dataset, filter)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Optional Filter — filter_if","text":"dataset Input dataset filter filter condition. Must expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Optional Filter — filter_if","text":"data.frame containing rows dataset matching filter just dataset filter NULL","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Return English-friendly messaging for object-types — friendly_type_of","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"Return English-friendly messaging object-types","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"","code":"friendly_type_of(x, value = TRUE, length = FALSE)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"x R object. value Whether describe value x. length Whether mention length vectors lists.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"string describing type. Starts indefinite article, e.g. \"integer vector\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"helper function aids us forming user-friendly messages gets called what_is_it(), often used assertion functions identify object-type user passed argument instead expected-type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Constant Variables — get_constant_vars","title":"Get Constant Variables — get_constant_vars","text":"Get Constant Variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Constant Variables — get_constant_vars","text":"","code":"get_constant_vars(dataset, by_vars, ignore_vars = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Constant Variables — get_constant_vars","text":"dataset data frame. by_vars variables groups defined variables considered separately. .e., variable constant within group, returned. ignore_vars Variables ignore specified variables considered, .e., returned even constant (unless included variables). Permitted Values: list variable names selector function calls like starts_with(\"EX\")","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Constant Variables — get_constant_vars","text":"Variable vector.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Retrieve Dataset admiraldev_environment environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"","code":"get_dataset(name)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"name name dataset retrieve","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Sometimes, developers may want provide information users fit warning error message. example, input dataset function contains unexpected records, can stored separate dataset, users can access investigate issue. achieve , R data structure known 'environment'. environment objects created build time, can populated values package loaded update values course R session. , establishment admiraldev_environment allows us create dynamic data/objects based user-inputs need modification. purpose get_dataset retrieve datasets contained inside admiraldev_environment. Currently support two datasets inside admiraldev_environment object: one_to_many many_to_one","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Duplicates From a Vector — get_duplicates","title":"Get Duplicates From a Vector — get_duplicates","text":"Get Duplicates Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Duplicates From a Vector — get_duplicates","text":"x atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Duplicates From a Vector — get_duplicates","text":"vector type x contain duplicate values","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(1:10) #> integer(0) get_duplicates(c(\"a\", \"a\", \"b\", \"c\", \"d\", \"d\")) #> [1] \"a\" \"d\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"Get New Temporary Variable Name Dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"get_new_tmp_var(dataset, prefix = \"tmp_var\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"dataset input dataset prefix prefix new temporary variable name create","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"name new temporary variable symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"function returns new unique temporary variable name used inside dataset. temporary variable names structure prefix_n n integer, e.g. tmp_var_1. already variable inside datset given prefix suffix increased 1, e.g. tmp_var_1 already exists get_new_tmp_var() return tmp_var_2.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) tmp_var <- get_new_tmp_var(dm) mutate(dm, !!tmp_var := NA) #> # A tibble: 2 × 4 #> DOMAIN STUDYID USUBJID tmp_var_1 #> #> 1 DM STUDY X 01-701-1015 NA #> 2 DM STUDY X 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Source Variables from a List of Expressions — get_source_vars","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"Get Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"","code":"get_source_vars(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":null,"dir":"Reference","previous_headings":"","what":"Negated Value Matching — %notin%","title":"Negated Value Matching — %notin%","text":"Returns logical vector indicating match left operand right operand.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Negated Value Matching — %notin%","text":"","code":"x %notin% table"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Negated Value Matching — %notin%","text":"x values matched table values matched ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Negated Value Matching — %notin%","text":"logical vector","code":""},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Or — %or%","text":"","code":"lhs %or% rhs"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Or — %or%","text":"lhs valid R expression rhs valid R expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Or — %or%","text":"Either result evaluating lhs, rhs error","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Or — %or%","text":"function evaluates expression lhs expression results error, catches error proceeds evaluating expression rhs returns result.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks if the argument equals the auto keyword — is_auto","title":"Checks if the argument equals the auto keyword — is_auto","text":"Checks argument equals auto keyword","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks if the argument equals the auto keyword — is_auto","text":"","code":"is_auto(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks if the argument equals the auto keyword — is_auto","text":"arg argument check","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Checks if the argument equals the auto keyword — is_auto","text":"TRUE argument equals auto keyword, .e., expression symbol named auto.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is order vars? — is_order_vars","title":"Is order vars? — is_order_vars","text":"Check inputs created using exprs() calls involving desc()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is order vars? — is_order_vars","text":"","code":"is_order_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is order vars? — is_order_vars","text":"arg R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is order vars? — is_order_vars","text":"FALSE argument list order vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Is this string a valid DTC — is_valid_dtc","title":"Is this string a valid DTC — is_valid_dtc","text":"string valid DTC","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is this string a valid DTC — is_valid_dtc","text":"","code":"is_valid_dtc(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is this string a valid DTC — is_valid_dtc","text":"arg character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is this string a valid DTC — is_valid_dtc","text":"TRUE argument valid --DTC string, FALSE otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":null,"dir":"Reference","previous_headings":"","what":"Join Functions — anti_join","title":"Join Functions — anti_join","text":"*_join() functions {dplyr} without warning different attributes datasets.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Join Functions — anti_join","text":"","code":"anti_join(x, y, by = NULL, copy = FALSE, ...) inner_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...) left_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Join Functions — anti_join","text":"x data.frame y data.frame character vector copy logical ... Additional arguments suffix character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Join Functions — anti_join","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Process set_values_to Argument — process_set_values_to","title":"Process set_values_to Argument — process_set_values_to","text":"function creates variables specified set_values_to argument, catches errors, provides user friendly error messages, optionally checks type created variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"process_set_values_to(dataset, set_values_to = NULL, expected_types = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process set_values_to Argument — process_set_values_to","text":"dataset Input dataset set_values_to Variables set named list returned exprs() defining variables set, e.g. exprs(PARAMCD = \"OS\", PARAM = \"Overall Survival\") expected. values must symbols, character strings, numeric values, expressions, NA. expected_types argument specified, specified variables checked whether specified type matches type variables created set_values_to. Permitted Values: character vector values \"numeric\" \"character\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process set_values_to Argument — process_set_values_to","text":"input dataset variables specified set_values_to added/updated","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"library(dplyr) data <- tribble( ~AVAL, 20 ) try( process_set_values_to( data, set_values_to = exprs( PARAMCD = BMI ) ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = BMI)) : #> Assigning variables failed! #> • `set_values_to = exprs(PARAMCD = BMI)` #> See error message below: #> ℹ In argument: `PARAMCD = BMI`. Caused by error: ! object 'BMI' not found try( process_set_values_to( data, set_values_to = exprs( PARAMCD = 42 ), expected_types = c(PARAMCD = \"character\") ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = 42), : #> The following variables have an unexpected type: #> • PARAMCD: expected is , but it is ."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"Remove Temporary Variables Created Within Current Function Environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"remove_tmp_vars(dataset)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"dataset input dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"input dataset temporary variables removed","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) dm <- select(dm, USUBJID) tmp_var <- get_new_tmp_var(dm) dm <- mutate(dm, !!tmp_var := NA) ## This function creates two new temporary variables which are removed when calling ## `remove_tmp_vars()`. Note that any temporary variable created outside this ## function is **not** removed do_something <- function(dataset) { tmp_var_1 <- get_new_tmp_var(dm) tmp_var_2 <- get_new_tmp_var(dm) dm %>% mutate(!!tmp_var_1 := NA, !!tmp_var_2 := NA) %>% print() %>% remove_tmp_vars() } do_something(dm) #> # A tibble: 2 × 4 #> USUBJID tmp_var_1 tmp_var_2 tmp_var_3 #> #> 1 01-701-1015 NA NA NA #> 2 01-701-1016 NA NA NA #> # A tibble: 2 × 2 #> USUBJID tmp_var_1 #> #> 1 01-701-1015 NA #> 2 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Symbols in an Expression — replace_symbol_in_expr","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Replace symbols expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"replace_symbol_in_expr(expression, target, replace)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression Expression target Target symbol replace Replacing symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression every occurrence symbol target replaced replace","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Stefan Bundfuss","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"library(rlang) replace_symbol_in_expr(expr(AVAL), target = AVAL, replace = AVAL.join) #> AVAL.join replace_symbol_in_expr(expr(AVALC), target = AVAL, replace = AVAL.join) #> AVALC replace_symbol_in_expr(expr(desc(AVAL)), target = AVAL, replace = AVAL.join) #> desc(AVAL.join)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Expression Value with Name — replace_values_by_names","title":"Replace Expression Value with Name — replace_values_by_names","text":"Replace Expression Value Name","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"replace_values_by_names(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Expression Value with Name — replace_values_by_names","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Expression Value with Name — replace_values_by_names","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"library(rlang) replace_values_by_names(exprs(AVAL, ADT = convert_dtc_to_dt(EXSTDTC))) #> [[1]] #> AVAL #> #> $ADT #> ADT #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Single Quotes — squote","title":"Wrap a String in Single Quotes — squote","text":"Wrap String Single Quotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Single Quotes — squote","text":"","code":"squote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Single Quotes — squote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Single Quotes — squote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":null,"dir":"Reference","previous_headings":"","what":"Suppress Specific Warnings — suppress_warning","title":"Suppress Specific Warnings — suppress_warning","text":"Suppress certain warnings issued expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Suppress Specific Warnings — suppress_warning","text":"","code":"suppress_warning(expr, regexpr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Suppress Specific Warnings — suppress_warning","text":"expr Expression executed regexpr Regular expression matching warnings suppress","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Suppress Specific Warnings — suppress_warning","text":"Return value expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Suppress Specific Warnings — suppress_warning","text":"warnings issued expression match regular expression suppressed.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":null,"dir":"Reference","previous_headings":"","what":"Valid Time Units — valid_time_units","title":"Valid Time Units — valid_time_units","text":"Contains acceptable character vector valid time units","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Valid Time Units — valid_time_units","text":"","code":"valid_time_units()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Valid Time Units — valid_time_units","text":"character vector valid time units","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn a List of Expressions into a Character Vector — vars2chr","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"Turn List Expressions Character Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"vars2chr(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"expressions list expressions created using exprs()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) vars2chr(exprs(USUBJID, AVAL)) #> #> \"USUBJID\" \"AVAL\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn if incomplete dtc — warn_if_incomplete_dtc","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"Warn incomplete dtc","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"","code":"warn_if_incomplete_dtc(dtc, n)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"dtc character vector date-times ISO 8601 format n non-negative integer","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"warning dtc contains partial dates","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"Checks two list inputs names number elements issues warning otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"warn_if_inconsistent_list(base, compare, list_name, i = 2)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"base named list compare named list list_name string name list index id compare 2 lists","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"warning 2 lists different names length","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) # no warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) # warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ, DTHVAR = \"text\"), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) #> Warning: The variables used for traceability in `Test` are not consistent, please check: #> source 1 , Variables are given as: DTHDOM DTHSEQ DTHVAR #> source 2 , Variables are given as: DTHDOM DTHSEQ"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"Warn vector contains unknown datetime format \"2003-12-15T-:15:18\", \"2003-12-15T13:-:19\",\"–12-15\",\"—–T07:15\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"warn_if_invalid_dtc(dtc, is_valid = is_valid_dtc(dtc))"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"dtc character vector containing dates is_valid logical vector indicating whether elements dtc valid","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"## No warning as `dtc` is a valid date format warn_if_invalid_dtc(dtc = \"2021-04-06\") ## Issues a warning warn_if_invalid_dtc(dtc = \"2021-04-06T-:30:30\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Variable Already Exists — warn_if_vars_exist","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"Warn variable already exists inside dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"warn_if_vars_exist(dataset, vars)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"dataset data.frame vars character vector columns check dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~USUBJID, ~ARM, \"01-701-1015\", \"Placebo\", \"01-701-1016\", \"Placebo\", ) ## No warning as `AAGE` doesn't exist in `dm` warn_if_vars_exist(dm, \"AAGE\") ## Issues a warning warn_if_vars_exist(dm, \"ARM\") #> Warning: Variable \"ARM\" already exists in the dataset."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":null,"dir":"Reference","previous_headings":"","what":"What Kind of Object is This? — what_is_it","title":"What Kind of Object is This? — what_is_it","text":"Returns string describing kind object input .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"What Kind of Object is This? — what_is_it","text":"x R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"What Kind of Object is This? — what_is_it","text":"character description type x","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(\"abc\") #> Warning: `what_is_it()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.obj_type_friendly {letters}}')`. #> [1] \"`\\\"abc\\\"`\" what_is_it(1L) #> [1] \"`1`\" what_is_it(1:10) #> [1] \"an integer vector\" what_is_it(mtcars) #> [1] \"a data frame\""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-development-version","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev (development version)","text":"following function arguments entering next phase deprecation process: (#2487) (#2595) Phase 1 (message) Phase 2 (warning) Phase 3 (error) Phase 4 (removed)","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-1-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 1.2.0","text":"New Function deprecate_inform() wrapper around lifecycle::deprecate_soft() allow control messaging. (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-2-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.2.0","text":"Objects passed assert_list_element() via ... argument can now used glue expression specified message_text argument. (#469) required_unit argument assert_unit() enhanced. now possible specify one unit specify . latter case uniqueness unit checked. (#468) assert_numeric_vector() function gained optional length argument check whether vector specific length. (#473)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.2.0","text":"admiraldev compatible R version >=4.1 (#456) following function arguments entering next phase deprecation process: (#459) Phase 1 (message) functions arguments Phase Phase 2 (warning) functions arguments Phase Phase 3 (error) functions arguments Phase Phase 4 (removed) argument quosures removed functions vars2chr(quosures), replace_values_by_names(quosures), get_source_vars(quosures) Removed v1.0.0 assert_named_expr() Removed v1.0.0 assert_has_variables() Removed v1.0.0 assert_function_param()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.2.0","text":"Deprecation Strategy updated long haul! (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-1-2-0","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev 1.2.0","text":"devcontainer files removed (#480)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-110","dir":"Changelog","previous_headings":"","what":"admiraldev 1.1.0","title":"admiraldev 1.1.0","text":"CRAN release: 2024-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.1.0","text":"Updated arg_name parameter assert_filter_cond, assert_symbol, assert_expr gsub(\"^enexpr\\\\((\\\\w+)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)) argument error messages return quoted argument without enexpr(), e.g. filter_add instead enexpr(filter_add). (#2404) Error messaging throughout package updated rlang::abort() cli::cli_abort(). part update, assert_*() functions new arguments assert_*(message, arg_name, call, class). (#367) Warning messaging also updated use cli messaging.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.1.0","text":"renv related files removed. (#360) longer exporting is_named() function. (#401) pharmaversesdtm removed dependency. (#434) part error messaging update, following changes made. assert_s3_class(class) argument renamed assert_s3_class(cls). (#367) Functions arg_name(), enumerate(), what_is_it(), friendly_type_of() deprecated warning returned developer using functions. developer functions (opposed functions typical admiral users), use short deprecation cycle.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.1.0","text":"“Release Strategy” vignette updated respect new branching strategy. (#353) “Release Strategy” vignette now contains short new “Release Tracking” section linking external dashboard CRAN packages awaiting release. (#358)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-1-1-0","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev 1.1.0","text":"Removed dependencies needed build package package documentation. (#426) Increased minimum R version required 4.0 match {admiral}. (#382) addin_format_testthat addin moved {pharmaverse4devs} package. (#419)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-100","dir":"Changelog","previous_headings":"","what":"admiraldev 1.0.0","title":"admiraldev 1.0.0","text":"CRAN release: 2023-12-15","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-0-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.0.0","text":"assert_function() now accepts function arguments ellipsis, ... function formals (#339)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.0.0","text":"assert_function_param() assert_named_expr() assert_has_variables()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-0-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.0.0","text":"New documentation programming strategy around quoting/expressions standardizing roxygen texts (#233, #332) New documentation use footnotes writing vignettes (#324) Updated language images adopt GitHub Flow Strategy (#349)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-050","dir":"Changelog","previous_headings":"","what":"admiraldev 0.5.0","title":"admiraldev 0.5.0","text":"CRAN release: 2023-09-11","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-5-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.5.0","text":"Calls admiral.test swapped pharmaversesdtm (#321) New vignette package writing extensions now available (#295, #312) New vignette creating test data now available (#282)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-5-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.5.0","text":"messaging warn_if_invalid_dtc() updated align date/datetime functions admiral currently . (#316)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.5.0","text":"assert_order_vars() quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names(), get_source_vars(), vars2chr(). (#288) assert_function_param() deprecated favor assert_function(). (#264) assert_named_expr() deprecated favor assert_expr_list(). (#264) assert_has_variables() deprecated favor assert_data_frame(). (#264)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-5-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.5.0","text":"Guidance around issues merging updated (#286) Common R CMD troubleshooting made separate vignette (#286) Documentation get_dataset() improved. (#271) Minor updates programming strategy added (#213, #240, #260) Updated unit testing vignette snapshot testing guidance. (#302) Documentation friendly_type_of() provided (#22) Minor updates pull request review guidance added (#201, #292) Documentation singular versus plural function argument names added programming strategy vignette. Also documentation common arguments missing_value missing_values added. (#296) Documentation highlighting difference set_values_to keep_source_vars (#318) List common arguments updated (#306)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-040","dir":"Changelog","previous_headings":"","what":"admiraldev 0.4.0","title":"admiraldev 0.4.0","text":"CRAN release: 2023-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-4-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.4.0","text":"New function assert_named() check elements argument named (#241) New function assert_expr_list() check argument list expressions (#241) Added Report bug link admiraldev website (#257)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.4.0","text":"assert_order_vars() deprecated favor assert_expr_list(). (#241) following functions deprecated previous admiral versions using next phase deprecation process: (#272) quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names().","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-4-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.4.0","text":"deprecation strategy updated regarding unit tests deprecated functions/arguments phase 1. (#247) programming strategy updated regarding permitted values calling functions package dependencies (#72, #253)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-030","dir":"Changelog","previous_headings":"","what":"admiraldev 0.3.0","title":"admiraldev 0.3.0","text":"CRAN release: 2023-03-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-3-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.3.0","text":"New function process_set_values_to() creating variables specified set_value_to argument catching errors (#70)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-3-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.3.0","text":"Using testthat3e (testthat 3rd edition) unit testing. stricter messages must addressed deprecated functions throw errors. (#230) Slight boost test coverage dev_utilities (#102) Fix datatable styling documentation (#197) assert_character_vector() function gained named argument check elements vector named. (#70) assert_list_of() function gained named argument check elements list named. (#203) quote_fun argument enumerate() extended NULL can specified request quoting elements. (#203) assert_list_of() function enhanced also considers type element, e.g., check value list symbols. (#208)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.3.0","text":"default value optional argument assert_date_vector(), assert_list_of(), assert_s3_class() changed TRUE FALSE make default behavior consistent. (#87) quo_c() replace_symbol_in_quo() quosures argument get_source_vars(), replace_values_by_names(), vars2chr()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-3-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.3.0","text":"New section programming strategy regarding comments (#71) Removed requirement add @author tags code scripts programming strategy, tracking authors DESCRIPTION file. Authors removed function documentation line update. (#206, #210) Removed -boarding Issue Template (#225) Increased clarity scope package (#232)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-020","dir":"Changelog","previous_headings":"","what":"admiraldev 0.2.0","title":"admiraldev 0.2.0","text":"CRAN release: 2022-11-30","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.2.0","text":"Developer addin formatting tests admiral programming standards (#73) New functions replace_symbol_in_quo() add_suffix_to_vars() (#106) New function assert_atomic_vector() (#98) New keyword/family create_aux functions creating auxiliary datasets (#126) New function assert_date_vector() (#129) New function assert_same_type() (#176) Remove dependency {assertthat} (#149) Test coverage admiraldev increased 45% approximately 100% (#94, #95, #96, #98, #101, #103) Environment objects consolidated single admiraldev_environment object R/admiraldev_environment.R. (#179)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.2.0","text":"expect_names argument added assert_vars() check variables named (#117) Remove dplyr function exports migration user facing function negate_vars() admiral (#83)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.2.0","text":"longer compatible admiral (<0.9)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.2.0","text":"New vignette package release strategy (#79) Updated multiple roxygen headers (#116, #133, #134, #141, #145, #172) Description admiral options work certain function inputs, .e subject_keys (#133)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-2-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.2.0","text":"PR Checklist Template updated (#172) New authors/contributors (#158)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-010","dir":"Changelog","previous_headings":"","what":"admiraldev 0.1.0","title":"admiraldev 0.1.0","text":"CRAN release: 2022-08-26","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-1-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.1.0","text":"Developer specific functions brought admiral Developer specific vignettes brought admiral New admiraldev website created","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-1-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.1.0","text":"NA","code":""}]
``` vs1 <- vs %>% derive_vars_dt( new_vars_prefix = \"A\", dtc = VSDTC, date_imputation = \"first\" ) ``` r dataset_vignette( vs1, display_vars = exprs(USUBJID, VSTESTCD, VISIT, VSDTC, ADT), filter = VSTESTCD == \"WEIGHT\" ) ```"},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"using-footnotes","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Using Footnotes","title":"Writing Vignettes","text":"Footnotes can useful add context without adding clutter primary subject matter vignette written. use footnotes, add caret identifier inside brackets e.g. ([^1]). identifiers can numbers words, can’t contain spaces tabs. following markdown text render follows: example 1","code":"Here is an example [^1] [^1]: Cool note about the example."},{"path":"https://pharmaverse.github.io/admiraldev/dev/articles/writing_vignettes.html","id":"conventions-for-adam-workflow","dir":"Articles","previous_headings":"Markdown > Format Sections > Conventions","what":"Conventions for ADaM Workflow","title":"Writing Vignettes","text":"vignettes describing ADaM workflow, second section summarize programming workflow. first sub-section within workflow always describe data read demonstrate use admiral functions, sub-section within programming workflow tagged (e.g. [Step1] (#step)), user can go relevant section programming workflow (addition Table contents). Don’t use tag number use meaningful name (e.g. use (#link1), use (#this_action)) last section link template script. ADSL variables ADSL variables required derivation merged SDTM dataset first derivation. ADSL variables added -variables derivations add observations. ensures ADSL variables populated new observations. adsl_vars variable created beginning script added by_vars parameter derivations add observations. ADSL variables final dataset required derivation merged dataset last derivation.","code":"# Programming Workflow * [Read in Data](#readdata) * [Derive/Impute End and Start Analysis Date/time and Relative Day](#datetime) * ... * [Assign `ASEQ`](#aseq) ## Read in Data {#readdata} ## Derive/Impute End and Start Analysis Date/time and Relative Day {#datetime} ## ... ## Assign `ASEQ` {#aseq} # Another Section # Example Script ADaM | Sample Code ---- | -------------- ADxx | [ad_adxx.R](https://github.com/pharmaverse/admiral/blob/main/inst/templates/ad_adxx.R){target=\"_blank\"}"},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ben Straub. Author, maintainer. Stefan Bundfuss. Author. Jeffrey Dickinson. Author. Ross Farrugia. Author. Fanny Gautier. Author. Edoardo Mancini. Author. Sadchla Mascary. Author. Gordon Miller. Author. Daniel Sjoberg. Author. Stefan Thoma. Author. Kangjie Zhang. Author. Zelos Zhu. Author. F. Hoffmann-La Roche AG. Copyright holder, funder. GlaxoSmithKline LLC. Copyright holder, funder.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Straub B, Bundfuss S, Dickinson J, Farrugia R, Gautier F, Mancini E, Mascary S, Miller G, Sjoberg D, Thoma S, Zhang K, Zhu Z (2025). admiraldev: Utility Functions Development Tools Admiral Package Family. R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/, https://pharmaverse.github.io/admiraldev/.","code":"@Manual{, title = {admiraldev: Utility Functions and Development Tools for the Admiral Package Family}, author = {Ben Straub and Stefan Bundfuss and Jeffrey Dickinson and Ross Farrugia and Fanny Gautier and Edoardo Mancini and Sadchla Mascary and Gordon Miller and Daniel Sjoberg and Stefan Thoma and Kangjie Zhang and Zelos Zhu}, year = {2025}, note = {R package version 1.2.0.9000, https://github.com/pharmaverse/admiraldev/}, url = {https://pharmaverse.github.io/admiraldev/}, }"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"admiraldev-","dir":"","previous_headings":"","what":"Utility Functions and Development Tools for the Admiral Package Family","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Utility Functions Development Tools Admiral Package Family","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"purpose","dir":"","previous_headings":"","what":"Purpose","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Functions, tools documentation developing core admiral extension package functions. functions admiraldev around testing inputs going functions. also additional quality life functions/Addins assist developers admiral admiral extension packages, functions help rendering documentation, Developer Guides developing function using GitHub, GitHub Actions. NOTE: package intended standalone use rather central dependency admiral extension packages","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"package available CRAN can installed running install.packages(\"admiraldev\"). install latest development version package directly GitHub use following code:","code":"if (!requireNamespace(\"remotes\", quietly = TRUE)) { install.packages(\"remotes\") } remotes::install_github(\"pharmaverse/admiraldev\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"release-schedule","dir":"","previous_headings":"","what":"Release Schedule","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"admiraldev released CRAN time official release admiral. can find release schedule admiral packages .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"Utility Functions and Development Tools for the Admiral Package Family","text":"Along authors contributors, thanks following people work package: Ania Golab, Samia Kabi, Pooja Kumari, Syed Mubasheer, Thomas Neitmann Ondrej Slama.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"Add suffix variables list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"add_suffix_to_vars(order, vars, suffix)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"order List expressions Permitted Values: list variables desc() function calls created exprs(), e.g., exprs(ADT, desc(AVAL)) vars Variables change Permitted Values: list variables created exprs() suffix Suffix Permitted Values: character scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"list expression element suffix (suffix) added every symbol specified vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/add_suffix_to_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Suffix to Variables in a List of Expressions — add_suffix_to_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) add_suffix_to_vars(exprs(ADT, desc(AVAL), AVALC), vars = exprs(AVAL), suffix = \".join\") #> [[1]] #> ADT #> #> [[2]] #> desc(AVAL.join) #> #> [[3]] #> AVALC #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":null,"dir":"Reference","previous_headings":"","what":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Utility functions check data, variables conditions functions used 'admiral' 'admiral' extension packages. Additional utility helper functions assist developers maintaining documentation, testing general upkeep 'admiral' 'admiral' extension packages.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/admiraldev-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"admiraldev: Utility Functions and Development Tools for the Admiral Package Family — admiraldev-package","text":"Maintainer: Ben Straub ben.x.straub@gsk.com Authors: Stefan Bundfuss (ORCID) Jeffrey Dickinson Ross Farrugia Fanny Gautier Edoardo Mancini (ORCID) Sadchla Mascary Gordon Miller Daniel Sjoberg (ORCID) Stefan Thoma (ORCID) Kangjie Zhang Zelos Zhu contributors: F. Hoffmann-La Roche AG [copyright holder, funder] GlaxoSmithKline LLC [copyright holder, funder]","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract Argument Name from an Expression — arg_name","title":"Extract Argument Name from an Expression — arg_name","text":"Extract Argument Name Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract Argument Name from an Expression — arg_name","text":"","code":"arg_name(expr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract Argument Name from an Expression — arg_name","text":"expr expression created inside function using substitute()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/arg_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract Argument Name from an Expression — arg_name","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Atomic Vector? — assert_atomic_vector","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"Checks argument atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"assert_atomic_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_atomic_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"function throws error arg atomic vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_atomic_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Atomic Vector? — assert_atomic_vector","text":"","code":"example_fun <- function(x) { assert_atomic_vector(x) } example_fun(1:10) try(example_fun(list(1, 2))) #> Error in example_fun(list(1, 2)) : #> Argument `x` must be an atomic vector, but is a list."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Scalar (String)? — assert_character_scalar","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"Checks argument character scalar (optionally) whether matches one provided values.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"assert_character_scalar( arg, values = NULL, case_sensitive = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"arg function argument checked values character vector valid values arg. Values converted lower case vector case_sensitive = FALSE used. case_sensitive argument handled case-sensitive? set FALSE, argument converted lower case checking permitted values returning argument. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"function throws error arg character vector arg character vector length > 1 value one values specified. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Scalar (String)? — assert_character_scalar","text":"","code":"example_fun <- function(msg_type) { assert_character_scalar(msg_type, values = c(\"warning\", \"error\")) } example_fun(\"warning\") try(example_fun(\"message\")) #> Error in example_fun(\"message\") : #> Argument `msg_type` must be equal to one of \"warning\" or \"error\". try(example_fun(TRUE)) #> Error in example_fun(TRUE) : #> Argument `msg_type` must be a scalar of class , but is #> `TRUE`. # handling arguments case-insensitive example_fun2 <- function(msg_type) { msg_type <- assert_character_scalar( msg_type, values = c(\"warning\", \"error\"), case_sensitive = FALSE ) if (msg_type == \"warning\") { print(\"A warning was requested.\") } } example_fun2(\"Warning\") #> [1] \"A warning was requested.\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Character Vector? — assert_character_vector","title":"Is an Argument a Character Vector? — assert_character_vector","text":"Checks argument character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"assert_character_vector( arg, values = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_character_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Character Vector? — assert_character_vector","text":"arg function argument checked values character vector valid values arg named set TRUE, error issued elements vector named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Character Vector? — assert_character_vector","text":"function throws error arg character vector element included list valid values. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_character_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Character Vector? — assert_character_vector","text":"","code":"example_fun <- function(chr) { assert_character_vector(chr) } example_fun(letters) try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `chr` must be , but is an integer vector. example_fun2 <- function(chr) { assert_character_vector(chr, named = TRUE) } try(example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\"))) #> Error in example_fun2(c(alpha = \"a\", \"b\", gamma = \"c\")) : #> All elements of `chr` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Data Frame? — assert_data_frame","title":"Is an Argument a Data Frame? — assert_data_frame","text":"Checks argument data frame (optionally) whether contains set required variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"assert_data_frame( arg, required_vars = NULL, check_is_grouped = TRUE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_data_frame\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Data Frame? — assert_data_frame","text":"arg function argument checked required_vars list variables created using exprs() check_is_grouped Throw error dataset grouped? Defaults TRUE. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Data Frame? — assert_data_frame","text":"function throws error arg data frame arg data frame misses variable specified required_vars. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_data_frame.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Data Frame? — assert_data_frame","text":"","code":"library(dplyr) library(rlang) dm <- tribble( ~STUDYID, ~USUBJID, \"XYZ\", \"1\", \"XYZ\", \"2\" ) example_fun <- function(dataset) { assert_data_frame(dataset, required_vars = exprs(STUDYID, USUBJID)) } example_fun(dm) try(example_fun(select(dm, -STUDYID))) #> Error in example_fun(select(dm, -STUDYID)) : #> Required variable `STUDYID` is missing in `dataset` try(example_fun(\"Not a dataset\")) #> Error in example_fun(\"Not a dataset\") : #> Argument `dataset` must be class , but is a string. try(example_fun(group_by(dm, USUBJID))) #> Error in example_fun(group_by(dm, USUBJID)) : #> Argument `dataset` must not be a grouped dataset, please `ungroup()` it."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"Checks variable dataset date datetime variable","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"assert_date_var( dataset, var, dataset_name = rlang::caller_arg(dataset), var_name = rlang::caller_arg(var), message = NULL, class = \"assert_date_var\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"dataset dataset variable expected var variable check dataset_name name dataset. argument specified, specified name displayed error message. var_name name variable. argument specified, specified name displayed error message. message (string) string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"var_name\" \"dataset_name\", can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"function throws error var date datetime variable dataset returns input invisibly otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is a Variable in a Dataset a Date or Datetime Variable? — assert_date_var","text":"","code":"library(lubridate) #> #> Attaching package: ‘lubridate’ #> The following objects are masked from ‘package:base’: #> #> date, intersect, setdiff, union library(dplyr) library(rlang) example_fun <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var(dataset = dataset, var = !!var) } my_data <- tribble( ~USUBJID, ~ADT, \"1\", ymd(\"2020-12-06\"), \"2\", ymd(\"\") ) example_fun( dataset = my_data, var = ADT ) try(example_fun( dataset = my_data, var = USUBJID )) #> Error in example_fun(dataset = my_data, var = USUBJID) : #> Column \"USUBJID\" in dataset `dataset` must be a date or datetime, but is #> a character vector. example_fun2 <- function(dataset, var) { var <- assert_symbol(enexpr(var)) assert_date_var( dataset = dataset, var = !!var, dataset_name = \"your_data\", var_name = \"your_var\" ) } try(example_fun2( dataset = my_data, var = USUBJID )) #> Error in example_fun2(dataset = my_data, var = USUBJID) : #> Column \"your_var\" in dataset `your_data` must be a date or datetime, but #> is a character vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object a date or datetime vector? — assert_date_vector","title":"Is an object a date or datetime vector? — assert_date_vector","text":"Check object/vector date datetime variable without needing dataset input","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"assert_date_vector( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_date_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object a date or datetime vector? — assert_date_vector","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL function assert_date_vector exits early throw error. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an object a date or datetime vector? — assert_date_vector","text":"function returns error arg missing, date datetime variable otherwise returns invisible output.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_date_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an object a date or datetime vector? — assert_date_vector","text":"","code":"example_fun <- function(arg) { assert_date_vector(arg) } example_fun( as.Date(\"2022-01-30\", tz = \"UTC\") ) try(example_fun(\"1993-07-14\")) #> Error in example_fun(\"1993-07-14\") : #> Argument `arg` must be a date or datetime, but is a string."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is an Expression — assert_expr","title":"Assert Argument is an Expression — assert_expr","text":"Assert Argument Expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is an Expression — assert_expr","text":"","code":"assert_expr( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_expr\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is an Expression — assert_expr","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is an Expression — assert_expr","text":"function throws error arg expression, .e. either symbol call, returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Expressions? — assert_expr_list","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"Checks argument list expressions.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"assert_expr_list( arg, required_elements = NULL, named = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_expr_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"arg function argument checked required_elements character vector names must present arg named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"function throws error arg list expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_expr_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Expressions? — assert_expr_list","text":"","code":"library(rlang) example_fun <- function(vars) { assert_expr_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\")))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ, !!list(\"a\"), !!list(\"a\"))) : #> All elements of `vars` must be an expression. #> ℹ `vars[[3]]` = `list(\"a\")` is of type , and `vars[[4]]` = `list(\"a\")` is #> of type "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Filter Condition? — assert_filter_cond","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Argument Filter Condition?","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"assert_filter_cond( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_filter_cond\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"arg Quosure - filtering condition. optional Logical - argument optional? Defaults FALSE. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Performs necessary checks returns arg pass. Otherwise throws informative error.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"Check arg suitable filtering condition used functions like subset dplyr::filter.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_filter_cond.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Filter Condition? — assert_filter_cond","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~STUDYID, ~USUBJID, ~AGE, \"DM\", \"STUDY X\", \"01-701-1015\", 64, \"DM\", \"STUDY X\", \"01-701-1016\", 65, ) # typical usage in a function as an argument check example_fun <- function(dat, x) { x <- assert_filter_cond(enexpr(x), arg_name = \"x\") filter(dat, !!x) } example_fun(dm, AGE == 64) #> # A tibble: 1 × 4 #> DOMAIN STUDYID USUBJID AGE #> #> 1 DM STUDY X 01-701-1015 64 try(assert_filter_cond(mtcars)) #> Error in eval(expr, envir) : #> Argument `mtcars` must be a filter condition, but is a data frame"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Is Argument a Function? — assert_function","title":"Is Argument a Function? — assert_function","text":"Checks argument function expected arguments provided function.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is Argument a Function? — assert_function","text":"","code":"assert_function( arg, params = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_function\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is Argument a Function? — assert_function","text":"arg function function checked params character vector character vector expected argument names aforementioned function arg. ellipsis, ..., included function formals function arg, argument, params ignored, accepting values character vector. optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is Argument a Function? — assert_function","text":"function throws error argument function function provide arguments specified params argument (assuming ellipsis function formals)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_function.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is Argument a Function? — assert_function","text":"","code":"example_fun <- function(fun) { assert_function(fun, params = c(\"x\")) } example_fun(mean) try(example_fun(1)) #> Error in example_fun(1) : #> Argument `fun` must be a function, but is a number. try(example_fun(sum)) #> Error in example_fun(sum) : #> \"x\" is not an argument of the function specified for `fun`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Integer Scalar? — assert_integer_scalar","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"Checks argument integer scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"assert_integer_scalar( arg, subset = \"none\", optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_integer_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"arg function argument checked subset subset integers arg part . one \"none\" (default), \"positive\", \"non-negative\" \"negative\". optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"function throws error arg integer belonging specified subset. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_integer_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Integer Scalar? — assert_integer_scalar","text":"","code":"example_fun <- function(num1, num2) { assert_integer_scalar(num1, subset = \"positive\") assert_integer_scalar(num2, subset = \"negative\") } example_fun(1, -9) try(example_fun(1.5, -9)) #> Error in example_fun(1.5, -9) : #> Argument `num1` must be a positive integer scalar. try(example_fun(2, 0)) #> Error in example_fun(2, 0) : #> Argument `num2` must be a negative integer scalar. try(example_fun(\"2\", 0)) #> Error in example_fun(\"2\", 0) : #> Argument `num1` must be a positive integer scalar."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"Checks elements list named lists/classes fulfill certain condition. , error issued elements list fulfilling condition listed.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"assert_list_element( list, element, condition, message_text, arg_name = rlang::caller_arg(list), message = NULL, class = \"assert_list_element\", call = parent.frame(), ... )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"list list checked list named lists classes expected. element name element lists/classes character scalar expected. condition Condition fulfilled condition evaluated element list. element lists/classes can referred name, e.g., censor == 0 check censor field class. message_text Text displayed error message listing values meet condition. text describe condition fulfilled, e.g., \"Error {arg_name}: censor values must zero.\". message argument specified, text displayed message_text ignored. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages. ... Objects required evaluate condition message text condition message text contains objects apart element, passed function. See second example .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"error condition met. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_element.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Element of a List of Lists/Classes Fulfilling a Condition? — assert_list_element","text":"","code":"death <- list( dataset_name = \"adsl\", date = \"DTHDT\", censor = 0 ) lstalv <- list( dataset_name = \"adsl\", date = \"LSTALVDT\", censor = 1 ) events <- list(death, lstalv) try(assert_list_element( list = events, element = \"censor\", condition = censor == 0, message_text = \"For events the censor values must be zero.\" )) #> Error in eval(expr, envir) : #> For events the censor values must be zero. #> ℹ But, `events[[2]]$censor = 1` try(assert_list_element( list = events, element = \"dataset_name\", condition = dataset_name %in% c(\"adrs\", \"adae\"), valid_datasets = c(\"adrs\", \"adae\"), message_text = paste( \"The dataset name must be one of the following: {.val {valid_datasets}}\" ) )) #> Error in eval(expr, envir) : #> The dataset name must be one of the following: \"adrs\" and \"adae\" #> ℹ But, `events[[1]]$dataset_name = adsl`, and `events[[2]]$dataset_name = adsl`"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"Checks argument list objects inheriting S3 class type specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"assert_list_of( arg, cls, named = FALSE, optional = TRUE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_list_of\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"arg function argument checked cls S3 class type check named set TRUE, error issued elements list named. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"function throws error arg list arg list elements objects inheriting class type class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_list_of.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Objects of a Specific S3 Class or Type? — assert_list_of","text":"","code":"example_fun <- function(list) { assert_list_of(list, \"data.frame\") } example_fun(list(mtcars, iris)) try(example_fun(list(letters, 1:10))) #> Error in example_fun(list(letters, 1:10)) : #> Each element of the list in argument `list` must be class/type #> . #> ℹ But, element 1 is a character vector, and element 2 is an integer vector try(example_fun(c(TRUE, FALSE))) #> Error in example_fun(c(TRUE, FALSE)) : #> Argument `list` must be class , but is a logical vector. example_fun2 <- function(list) { assert_list_of(list, \"numeric\", named = TRUE) } try(example_fun2(list(1, 2, 3, d = 4))) #> Error in example_fun2(list(1, 2, 3, d = 4)) : #> All elements of `list` argument must be named. #> ℹ The indices of the unnamed elements are 1, 2, and 3"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"Checks argument logical scalar","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"assert_logical_scalar( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_logical_scalar\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown. Otherwise, NULL considered valid value. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"function throws error arg neither TRUE FALSE. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_logical_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Logical Scalar (Boolean)? — assert_logical_scalar","text":"","code":"example_fun <- function(flag) { assert_logical_scalar(flag) } example_fun(FALSE) try(example_fun(NA)) #> Error in example_fun(NA) : #> Argument `flag` must be either TRUE or FALSE, but is `NA`. try(example_fun(c(TRUE, FALSE, FALSE))) #> Error in example_fun(c(TRUE, FALSE, FALSE)) : #> Argument `flag` must be either TRUE or FALSE, but is a logical vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `flag` must be either TRUE or FALSE, but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Argument is a Named List or Vector — assert_named","title":"Assert Argument is a Named List or Vector — assert_named","text":"Assert elements argument named.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"assert_named( arg, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_named\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Argument is a Named List or Vector — assert_named","text":"arg function argument checked optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Argument is a Named List or Vector — assert_named","text":"function throws error arg named list vector returns input invisibly otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_named.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert Argument is a Named List or Vector — assert_named","text":"","code":"example_fun <- function(varval_list) { assert_named(varval_list) } example_fun(list(var1 = 1, var2 = \"x\")) try(example_fun(list(1, \"x\"))) #> Error in example_fun(list(1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 1 and 2 try(example_fun(list(var = 1, \"x\"))) #> Error in example_fun(list(var = 1, \"x\")) : #> All elements of `varval_list` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Numeric Vector? — assert_numeric_vector","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"Checks argument numeric vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"assert_numeric_vector( arg, length = NULL, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_numeric_vector\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"arg function argument checked length Expected length argument specified set NULL, length accepted. optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"function throws error arg numeric vector. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_numeric_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Numeric Vector? — assert_numeric_vector","text":"","code":"example_fun <- function(num) { assert_numeric_vector(num) } example_fun(1:10) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `num` must be a numeric vector, but it is a character vector. example_fun <- function(num) { assert_numeric_vector(num, length = 2) } try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `num` must be a vector of length 2, but has length 10."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":null,"dir":"Reference","previous_headings":"","what":"Is There a One to One Mapping between Variables? — assert_one_to_one","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"Checks one one mapping two lists variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"assert_one_to_one( dataset, vars1, vars2, dataset_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_one_to_one\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"dataset Dataset checked variables specified vars1 vars2 expected. vars1 First list variables vars2 Second list variables dataset_name string indicating label/symbol object checked. Default rlang::caller_arg(dataset). message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"dataset_name\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"error condition meet. input otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_one_to_one.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is There a One to One Mapping between Variables? — assert_one_to_one","text":"","code":"library(dplyr) library(rlang) df <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 1L ) assert_one_to_one(df, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) df_many <- tribble( ~SPECIES, ~SPECIESN, \"DOG\", 1L, \"CAT\", 2L, \"DOG\", 3L ) try( assert_one_to_one(df_many, vars1 = exprs(SPECIES), vars2 = exprs(SPECIESN)) ) #> Error in eval(expr, envir) : #> For some values of \"SPECIES\" there is more than one value of \"SPECIESN\" #> ℹ Call `admiral::get_one_to_many_dataset()` to get all one-to-many values. try( assert_one_to_one(df_many, vars1 = exprs(SPECIESN), vars2 = exprs(SPECIES)) ) #> Error in eval(expr, envir) : #> There is more than one value of \"SPECIESN\" for some values of \"SPECIES\" #> ℹ Call `admiral::get_many_to_one_dataset()` to get all many-to-one values."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"Checks parameter (PARAMCD) exist dataset.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"assert_param_does_not_exist( dataset, param, arg_name = rlang::caller_arg(dataset), message = NULL, class = \"assert_param_does_not_exist\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"dataset data.frame param Parameter code check arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"function throws error parameter exists input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_param_does_not_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter Does Not Exist in the Dataset — assert_param_does_not_exist","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_param_does_not_exist(advs, param = \"HR\") try(assert_param_does_not_exist(advs, param = \"WEIGHT\")) #> Error in eval(expr, envir) : #> The parameter code \"WEIGHT\" already exists in dataset `advs`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"Checks argument object inheriting S3 class specified.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"assert_s3_class( arg, cls, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_s3_class\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"arg function argument checked cls S3 class check optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"function throws error arg object inherit class. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_s3_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument an Object of a Specific S3 Class? — assert_s3_class","text":"","code":"example_fun <- function(obj) { assert_s3_class(obj, \"factor\") } example_fun(as.factor(letters)) try(example_fun(letters)) #> Error in example_fun(letters) : #> Argument `obj` must be class , but is a character vector. try(example_fun(1:10)) #> Error in example_fun(1:10) : #> Argument `obj` must be class , but is an integer vector."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Are All Argument of the Same Type? — assert_same_type","title":"Are All Argument of the Same Type? — assert_same_type","text":"Checks arguments type.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"assert_same_type( ..., .message = c(\"Arguments {.arg {arg_names}} must be the same type.\", i = paste(\"Argument types are\", paste0(\"{.arg \", arg_names, \"} {.cls \", types, \"}\", collapse = \", \"))), .class = \"assert_same_type\", .call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Are All Argument of the Same Type? — assert_same_type","text":"... Arguments checked .message character vector passed cli_abort(message) assertion fails. .class character vector passed cli_abort(class) assertion fails. .call environment passed cli_abort(call) assertion fails.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Are All Argument of the Same Type? — assert_same_type","text":"function throws error arguments type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_same_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Are All Argument of the Same Type? — assert_same_type","text":"","code":"example_fun <- function(true_value, false_value, missing_value) { assert_same_type(true_value, false_value, missing_value) } example_fun( true_value = \"Y\", false_value = \"N\", missing_value = NA_character_ ) try(example_fun( true_value = 1, false_value = 0, missing_value = \"missing\" )) #> Error in example_fun(true_value = 1, false_value = 0, missing_value = \"missing\") : #> Arguments `true_value`, `false_value`, and `missing_value` must be the #> same type. #> ℹ Argument types are `true_value` , `false_value` , #> `missing_value` "},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Symbol? — assert_symbol","title":"Is an Argument a Symbol? — assert_symbol","text":"Checks argument symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"assert_symbol( arg, optional = FALSE, arg_name = gsub(\"^enexpr\\\\((.*)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)), message = NULL, class = \"assert_symbol\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Symbol? — assert_symbol","text":"arg function argument checked. Must symbol. See examples. optional checked argument optional? set FALSE arg NULL error thrown. arg_name default expression specified arg used. form enexpr(), enexpr() part removed. example arg = enexpr(filter_add) specified, arg_name defaults \"filter_add\" message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Symbol? — assert_symbol","text":"function throws error arg symbol returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_symbol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Symbol? — assert_symbol","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) dm <- dplyr::tribble( ~DOMAIN, ~USUBJID, \"DM\", \"01-701-1015\", \"DM\", \"01-701-1016\", ) example_fun <- function(dat, var) { var <- assert_symbol(enexpr(var)) select(dat, !!var) } example_fun(dm, USUBJID) #> # A tibble: 2 × 1 #> USUBJID #> #> 1 01-701-1015 #> 2 01-701-1016 try(example_fun(dm)) #> Error in example_fun(dm) : #> Argument `var` must be a , but is missing. try(example_fun(dm, \"USUBJID\")) #> Error in example_fun(dm, \"USUBJID\") : #> Argument `var` must be a , but is a string. try(example_fun(dm, toupper(PARAMCD))) #> Error in example_fun(dm, toupper(PARAMCD)) : #> Argument `var` must be a , but is a call."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":null,"dir":"Reference","previous_headings":"","what":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"Checks parameter (PARAMCD) dataset provided expected unit.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"assert_unit( dataset, param, required_unit = NULL, get_unit_expr, arg_name = rlang::caller_arg(required_unit), message = NULL, class = \"assert_unit\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"dataset Dataset checked variable PARAMCD used get_unit_expr expected. param Parameter code parameter check required_unit Expected unit(s) argument set NULL, checked whether unit unique within parameter. Permitted Values: character vector NULL get_unit_expr Expression used provide unit param arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"function throws error one non-missing unit dataset unit variable differs expected unit observation parameter input dataset. Otherwise, dataset returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_unit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Asserts That a Parameter is Provided in the Expected Unit — assert_unit","text":"","code":"library(dplyr) advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85.7, \"kg\", \"WEIGHT\", 85.7 ) assert_unit(advs, param = \"WEIGHT\", required_unit = \"kg\", get_unit_expr = VSSTRESU) try( assert_unit( advs, param = \"WEIGHT\", required_unit = c(\"g\", \"mg\"), get_unit_expr = VSSTRESU ) ) #> Error in eval(expr, envir) : #> It is expected that \"WEIGHT\" has unit of \"g\" or \"mg\". In the input #> dataset the unit is \"kg\". # Checking uniqueness of unit only advs <- tribble( ~USUBJID, ~VSTESTCD, ~VSTRESN, ~VSSTRESU, ~PARAMCD, ~AVAL, \"P01\", \"WEIGHT\", 80.1, \"kg\", \"WEIGHT\", 80.1, \"P02\", \"WEIGHT\", 85700, \"g\", \"WEIGHT\", 85700 ) try( assert_unit(advs, param = \"WEIGHT\", get_unit_expr = VSSTRESU) ) #> Error in eval(expr, envir) : #> Multiple units \"kg\" and \"g\" found for \"WEIGHT\". Please review and update #> the units."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a List of Variables? — assert_vars","title":"Is an Argument a List of Variables? — assert_vars","text":"Checks argument valid list symbols (e.g., created exprs())","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"assert_vars( arg, expect_names = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_vars\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a List of Variables? — assert_vars","text":"arg function argument checked expect_names argument set TRUE, checked variables named, e.g., exprs(APERSDT = APxxSDT, APEREDT = APxxEDT). optional checked argument optional? set FALSE arg NULL error thrown arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a List of Variables? — assert_vars","text":"function throws error arg list symbols (e.g., created exprs() returns input invisibly otherwise.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a List of Variables? — assert_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(by_vars) { assert_vars(by_vars) } example_fun(exprs(USUBJID, PARAMCD)) try(example_fun(quos(USUBJID, PARAMCD))) #> Error in example_fun(quos(USUBJID, PARAMCD)) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 1 is a object, and element 2 is a object try(example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\"))) #> Error in example_fun(c(\"USUBJID\", \"PARAMCD\", \"VISIT\")) : #> Argument `by_vars` must be class , but is a character vector. try(example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL)))) #> Error in example_fun(exprs(USUBJID, toupper(PARAMCD), desc(AVAL))) : #> Each element of the list in argument `by_vars` must be class/type #> . #> ℹ But, element 2 is a call, and element 3 is a call example_fun_name <- function(by_vars) { assert_vars(by_vars, expect_names = TRUE) } example_fun_name(exprs(APERSDT = APxxSDT, APEREDT = APxxEDT)) try(example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT))) #> Error in example_fun_name(exprs(APERSDT = APxxSDT, APxxEDT)) : #> All elements of `by_vars` argument must be named. #> ℹ The indices of the unnamed elements are 2"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an Argument a Variable-Value List? — assert_varval_list","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"Checks argument list expressions expressions variable-value pairs. value can symbol, string, numeric, expression, NA.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"assert_varval_list( arg, required_elements = NULL, accept_expr = TRUE, accept_var = FALSE, optional = FALSE, arg_name = rlang::caller_arg(arg), message = NULL, class = \"assert_varval_list\", call = parent.frame() )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"arg function argument checked required_elements character vector names must present arg accept_expr expressions right hand side accepted? accept_var unnamed variable names (e.g. exprs(USUBJID)) right hand side accepted? optional checked argument optional? set FALSE arg NULL error thrown. arg_name string indicating label/symbol object checked. message string passed cli::cli_abort(message). NULL, default messaging used (see examples default messages). \"{arg_name}\" can used messaging. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"function throws error arg list variable-value expressions. Otherwise, input returned invisibly.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/assert_varval_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Is an Argument a Variable-Value List? — assert_varval_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) example_fun <- function(vars) { assert_varval_list(vars) } example_fun(exprs(DTHDOM = \"AE\", DTHSEQ = AESEQ)) try(example_fun(exprs(\"AE\", DTSEQ = AESEQ))) #> Error in example_fun(exprs(\"AE\", DTSEQ = AESEQ)) : #> Argument `vars` must be a named list of expressions where each element #> is a symbol, character scalar, numeric scalar, an expression, or NA, but is a #> list. #> ℹ To create a list of expressions use `exprs()`."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Backquotes — backquote","title":"Wrap a String in Backquotes — backquote","text":"Wrap String Backquotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Backquotes — backquote","text":"","code":"backquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Backquotes — backquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/backquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Backquotes — backquote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"check argument contains valid variable(s) created exprs() Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"","code":"contains_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"arg function argument checked","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/contains_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"check that argument contains valid variable(s) created with exprs() or Source Variables from a List of Expressions — contains_vars","text":"TRUE variables valid variable","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"Helper Function Convert Date (Date-time) Objects Characters dtc Format (-DTC type variable)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"","code":"convert_dtm_to_dtc(dtm)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"dtm date date-time","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/convert_dtm_to_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper Function to Convert Date (or Date-time) Objects to Characters of dtc Format (-DTC type of variable) — convert_dtm_to_dtc","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":null,"dir":"Reference","previous_headings":"","what":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"Output dataset vignette pre-specified admiral format.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"","code":"dataset_vignette(dataset, display_vars = NULL, filter = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"dataset Dataset output vignette display_vars Variables selected demonstrate outcome derivation Permitted Values: list variables Default NULL display_vars NULL, selected variables visible vignette variables hidden. can made visible clicking theChoose columns display button. filter Filter condition specified condition applied dataset displayed. Permitted Values: condition","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dataset_vignette.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Output a Dataset in a Vignette in the admiral Format — dataset_vignette","text":"HTML table","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecation with Soft Message — deprecate_inform","title":"Deprecation with Soft Message — deprecate_inform","text":"Wrapper around lifecycle::deprecate_soft() messages users deprecated features functions instead warning.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"deprecate_inform( when, what, with = NULL, details = NULL, id = NULL, env = rlang::caller_env(), user_env = rlang::caller_env(2) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecation with Soft Message — deprecate_inform","text":"string giving version behaviour deprecated. string describing deprecated: Deprecate whole function \"foo()\". Deprecate argument \"foo(arg)\". Partially deprecate argument \"foo(arg = 'must scalar integer')\". Deprecate anything else custom message wrapping (). can optionally supply namespace: \"ns::foo()\", usually needed inferred caller environment. optional string giving recommended replacement deprecated behaviour. takes form . details cases deprecation message can automatically generated . , use details provide hand-written message. details can either single string character vector, converted bulleted list. default, info bullets used. Provide named vectors override. id id deprecation. warning issued id. Defaults generated message, give unique ID message details built programmatically depends inputs, like deprecate multiple functions warn . env, user_env Pair environments define deprecate_*() called (used determine package name) function called deprecating function called (used determine deprecate_soft() message). needed calling deprecate_*() internal helper, case forward env = caller_env() user_env = caller_env(2).","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecation with Soft Message — deprecate_inform","text":"NULL, invisibly.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/deprecate_inform.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deprecation with Soft Message — deprecate_inform","text":"","code":"# A Phase 1 deprecated function with custom bulleted list: deprecate_inform( when = \"1.0.0\", what = \"foo()\", details = c( x = \"This message will turn into a warning with release of x.y.z\", i = \"See admiral's deprecation guidance: https://pharmaverse.github.io/admiraldev/dev/articles/programming_strategy.html#deprecation\" ) )"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Double Quotes — dquote","title":"Wrap a String in Double Quotes — dquote","text":"Wrap string double quotes, e.g., displaying character values messages.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Double Quotes — dquote","text":"","code":"dquote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Double Quotes — dquote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/dquote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Double Quotes — dquote","text":"input NULL, text \"NULL\" returned. Otherwise, input double quotes returned.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate Multiple Elements — enumerate","title":"Enumerate Multiple Elements — enumerate","text":"Enumerate multiple elements vector list.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(x, quote_fun = backquote, conjunction = \"and\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate Multiple Elements — enumerate","text":"x vector list quote_fun Quoting function, defaults backquote. set NULL, elements quoted. conjunction Character used message, defaults \"\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate Multiple Elements — enumerate","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/enumerate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate Multiple Elements — enumerate","text":"","code":"enumerate(c(\"one\", \"two\", \"three\")) #> Warning: `enumerate()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.val {letters[1:3]}}')` #> [1] \"`one`, `two` and `three`\" enumerate(c(1, 2, 3), quote_fun = NULL) #> [1] \"1, 2 and 3\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"Uses diffdf::diffdf() compares 2 datasets differences. function can thought R-equivalent SAS proc compare useful tool unit testing well.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"expect_dfs_equal(base, compare, keys, ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"base Input dataset compare Comparison dataset keys character vector variables define unique row base compare datasets ... Additional arguments passed onto diffdf::diffdf()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"error base compare match NULL invisibly ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expect_dfs_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Expectation: Are Two Datasets Equal? — expect_dfs_equal","text":"","code":"library(dplyr, warn.conflicts = FALSE) tbl1 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 19, \"F\", \"1003\", 20, \"M\", \"1004\", 18, \"F\" ) tbl2 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1001\", 18, \"M\", \"1002\", 18.9, \"F\", \"1003\", 20, NA ) try(expect_dfs_equal(tbl1, tbl2, keys = \"USUBJID\")) #> Error : Differences found between the objects! #> #> Summary of BASE and COMPARE #> ================================================================== #> PROPERTY BASE COMP #> ------------------------------------------------------------------ #> Name base compare #> Class \"tbl_df, tbl, data.frame\" \"tbl_df, tbl, data.frame\" #> Rows(#) 4 3 #> Columns(#) 3 3 #> ------------------------------------------------------------------ #> #> #> There are rows in BASE that are not in COMPARE !! #> ========= #> USUBJID #> --------- #> 1004 #> --------- #> #> #> Not all Values Compared Equal #> ============================= #> Variable No of Differences #> ----------------------------- #> AGE 1 #> SEX 1 #> ----------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> AGE 1002 19 18.9 #> ---------------------------------- #> #> #> ================================== #> VARIABLE USUBJID BASE COMPARE #> ---------------------------------- #> SEX 1003 M #> ---------------------------------- #> #> tlb3 <- tribble( ~USUBJID, ~AGE, ~SEX, \"1004\", 18, \"F\", \"1003\", 20, \"M\", \"1002\", 19, \"F\", \"1001\", 18, \"M\", ) # Note the sorting order of the keys is not required expect_dfs_equal(tbl1, tlb3, keys = \"USUBJID\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":null,"dir":"Reference","previous_headings":"","what":"Concatenate One or More Expressions — expr_c","title":"Concatenate One or More Expressions — expr_c","text":"Concatenate One Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concatenate One or More Expressions — expr_c","text":"","code":"expr_c(...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concatenate One or More Expressions — expr_c","text":"... One expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/expr_c.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concatenate One or More Expressions — expr_c","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract All Symbols from a List of Expressions — extract_vars","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"Extract Symbols List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"extract_vars(x, side = \"lhs\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"x R object side One \"lhs\" (default) \"rhs\" formulas","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/extract_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract All Symbols from a List of Expressions — extract_vars","text":"","code":"library(rlang) extract_vars(exprs(PARAMCD, (BASE - AVAL) / BASE + 100)) #> [[1]] #> PARAMCD #> #> [[2]] #> BASE #> #> [[3]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1) #> [[1]] #> AVAL #> extract_vars(AVAL ~ ARMCD + AGEGR1, side = \"rhs\") #> [[1]] #> ARMCD #> #> [[2]] #> AGEGR1 #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Optional Filter — filter_if","title":"Optional Filter — filter_if","text":"Filters input dataset provided expression NULL","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optional Filter — filter_if","text":"","code":"filter_if(dataset, filter)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Optional Filter — filter_if","text":"dataset Input dataset filter filter condition. Must expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/filter_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Optional Filter — filter_if","text":"data.frame containing rows dataset matching filter just dataset filter NULL","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Return English-friendly messaging for object-types — friendly_type_of","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"Return English-friendly messaging object-types","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"","code":"friendly_type_of(x, value = TRUE, length = FALSE)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"x R object. value Whether describe value x. length Whether mention length vectors lists.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"string describing type. Starts indefinite article, e.g. \"integer vector\".","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/friendly_type_of.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Return English-friendly messaging for object-types — friendly_type_of","text":"helper function aids us forming user-friendly messages gets called what_is_it(), often used assertion functions identify object-type user passed argument instead expected-type.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Constant Variables — get_constant_vars","title":"Get Constant Variables — get_constant_vars","text":"Get Constant Variables","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Constant Variables — get_constant_vars","text":"","code":"get_constant_vars(dataset, by_vars, ignore_vars = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Constant Variables — get_constant_vars","text":"dataset data frame. by_vars variables groups defined variables considered separately. .e., variable constant within group, returned. ignore_vars Variables ignore specified variables considered, .e., returned even constant (unless included variables). Permitted Values: list variable names selector function calls like starts_with(\"EX\")","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_constant_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Constant Variables — get_constant_vars","text":"Variable vector.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Retrieve Dataset admiraldev_environment environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"","code":"get_dataset(name)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"name name dataset retrieve","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_dataset.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Retrieve a Dataset from the admiraldev_environment environment — get_dataset","text":"Sometimes, developers may want provide information users fit warning error message. example, input dataset function contains unexpected records, can stored separate dataset, users can access investigate issue. achieve , R data structure known 'environment'. environment objects created build time, can populated values package loaded update values course R session. , establishment admiraldev_environment allows us create dynamic data/objects based user-inputs need modification. purpose get_dataset retrieve datasets contained inside admiraldev_environment. Currently support two datasets inside admiraldev_environment object: one_to_many many_to_one","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Duplicates From a Vector — get_duplicates","title":"Get Duplicates From a Vector — get_duplicates","text":"Get Duplicates Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Duplicates From a Vector — get_duplicates","text":"x atomic vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Duplicates From a Vector — get_duplicates","text":"vector type x contain duplicate values","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Duplicates From a Vector — get_duplicates","text":"","code":"get_duplicates(1:10) #> integer(0) get_duplicates(c(\"a\", \"a\", \"b\", \"c\", \"d\", \"d\")) #> [1] \"a\" \"d\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"Get New Temporary Variable Name Dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"get_new_tmp_var(dataset, prefix = \"tmp_var\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"dataset input dataset prefix prefix new temporary variable name create","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"name new temporary variable symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"function returns new unique temporary variable name used inside dataset. temporary variable names structure prefix_n n integer, e.g. tmp_var_1. already variable inside datset given prefix suffix increased 1, e.g. tmp_var_1 already exists get_new_tmp_var() return tmp_var_2.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_new_tmp_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a New Temporary Variable Name for a Dataset — get_new_tmp_var","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) tmp_var <- get_new_tmp_var(dm) mutate(dm, !!tmp_var := NA) #> # A tibble: 2 × 4 #> DOMAIN STUDYID USUBJID tmp_var_1 #> #> 1 DM STUDY X 01-701-1015 NA #> 2 DM STUDY X 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Source Variables from a List of Expressions — get_source_vars","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"Get Source Variables List Expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"","code":"get_source_vars(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/get_source_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Source Variables from a List of Expressions — get_source_vars","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":null,"dir":"Reference","previous_headings":"","what":"Negated Value Matching — %notin%","title":"Negated Value Matching — %notin%","text":"Returns logical vector indicating match left operand right operand.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Negated Value Matching — %notin%","text":"","code":"x %notin% table"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Negated Value Matching — %notin%","text":"x values matched table values matched ","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-notin-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Negated Value Matching — %notin%","text":"logical vector","code":""},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Or — %or%","text":"","code":"lhs %or% rhs"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Or — %or%","text":"lhs valid R expression rhs valid R expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Or — %or%","text":"Either result evaluating lhs, rhs error","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/grapes-or-grapes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Or — %or%","text":"function evaluates expression lhs expression results error, catches error proceeds evaluating expression rhs returns result.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks if the argument equals the auto keyword — is_auto","title":"Checks if the argument equals the auto keyword — is_auto","text":"Checks argument equals auto keyword","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks if the argument equals the auto keyword — is_auto","text":"","code":"is_auto(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks if the argument equals the auto keyword — is_auto","text":"arg argument check","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_auto.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Checks if the argument equals the auto keyword — is_auto","text":"TRUE argument equals auto keyword, .e., expression symbol named auto.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Is order vars? — is_order_vars","title":"Is order vars? — is_order_vars","text":"Check inputs created using exprs() calls involving desc()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is order vars? — is_order_vars","text":"","code":"is_order_vars(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is order vars? — is_order_vars","text":"arg R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_order_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is order vars? — is_order_vars","text":"FALSE argument list order vars","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Is this string a valid DTC — is_valid_dtc","title":"Is this string a valid DTC — is_valid_dtc","text":"string valid DTC","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is this string a valid DTC — is_valid_dtc","text":"","code":"is_valid_dtc(arg)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is this string a valid DTC — is_valid_dtc","text":"arg character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/is_valid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is this string a valid DTC — is_valid_dtc","text":"TRUE argument valid --DTC string, FALSE otherwise","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":null,"dir":"Reference","previous_headings":"","what":"Join Functions — anti_join","title":"Join Functions — anti_join","text":"*_join() functions {dplyr} without warning different attributes datasets.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Join Functions — anti_join","text":"","code":"anti_join(x, y, by = NULL, copy = FALSE, ...) inner_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...) left_join(x, y, by = NULL, copy = FALSE, suffix = c(\".x\", \".y\"), ...)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Join Functions — anti_join","text":"x data.frame y data.frame character vector copy logical ... Additional arguments suffix character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/joins.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Join Functions — anti_join","text":"data.frame","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Process set_values_to Argument — process_set_values_to","title":"Process set_values_to Argument — process_set_values_to","text":"function creates variables specified set_values_to argument, catches errors, provides user friendly error messages, optionally checks type created variables.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"process_set_values_to(dataset, set_values_to = NULL, expected_types = NULL)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process set_values_to Argument — process_set_values_to","text":"dataset Input dataset set_values_to Variables set named list returned exprs() defining variables set, e.g. exprs(PARAMCD = \"OS\", PARAM = \"Overall Survival\") expected. values must symbols, character strings, numeric values, expressions, NA. expected_types argument specified, specified variables checked whether specified type matches type variables created set_values_to. Permitted Values: character vector values \"numeric\" \"character\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process set_values_to Argument — process_set_values_to","text":"input dataset variables specified set_values_to added/updated","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/process_set_values_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process set_values_to Argument — process_set_values_to","text":"","code":"library(dplyr) data <- tribble( ~AVAL, 20 ) try( process_set_values_to( data, set_values_to = exprs( PARAMCD = BMI ) ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = BMI)) : #> Assigning variables failed! #> • `set_values_to = exprs(PARAMCD = BMI)` #> See error message below: #> ℹ In argument: `PARAMCD = BMI`. Caused by error: ! object 'BMI' not found try( process_set_values_to( data, set_values_to = exprs( PARAMCD = 42 ), expected_types = c(PARAMCD = \"character\") ) ) #> Error in process_set_values_to(data, set_values_to = exprs(PARAMCD = 42), : #> The following variables have an unexpected type: #> • PARAMCD: expected is , but it is ."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"Remove Temporary Variables Created Within Current Function Environment","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"remove_tmp_vars(dataset)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"dataset input dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"input dataset temporary variables removed","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/remove_tmp_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove All Temporary Variables Created Within the Current Function Environment — remove_tmp_vars","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~DOMAIN, ~STUDYID, ~USUBJID, \"DM\", \"STUDY X\", \"01-701-1015\", \"DM\", \"STUDY X\", \"01-701-1016\", ) dm <- select(dm, USUBJID) tmp_var <- get_new_tmp_var(dm) dm <- mutate(dm, !!tmp_var := NA) ## This function creates two new temporary variables which are removed when calling ## `remove_tmp_vars()`. Note that any temporary variable created outside this ## function is **not** removed do_something <- function(dataset) { tmp_var_1 <- get_new_tmp_var(dm) tmp_var_2 <- get_new_tmp_var(dm) dm %>% mutate(!!tmp_var_1 := NA, !!tmp_var_2 := NA) %>% print() %>% remove_tmp_vars() } do_something(dm) #> # A tibble: 2 × 4 #> USUBJID tmp_var_1 tmp_var_2 tmp_var_3 #> #> 1 01-701-1015 NA NA NA #> 2 01-701-1016 NA NA NA #> # A tibble: 2 × 2 #> USUBJID tmp_var_1 #> #> 1 01-701-1015 NA #> 2 01-701-1016 NA"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Symbols in an Expression — replace_symbol_in_expr","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Replace symbols expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"replace_symbol_in_expr(expression, target, replace)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression Expression target Target symbol replace Replacing symbol","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"expression every occurrence symbol target replaced replace","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"Stefan Bundfuss","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_symbol_in_expr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Symbols in an Expression — replace_symbol_in_expr","text":"","code":"library(rlang) replace_symbol_in_expr(expr(AVAL), target = AVAL, replace = AVAL.join) #> AVAL.join replace_symbol_in_expr(expr(AVALC), target = AVAL, replace = AVAL.join) #> AVALC replace_symbol_in_expr(expr(desc(AVAL)), target = AVAL, replace = AVAL.join) #> desc(AVAL.join)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace Expression Value with Name — replace_values_by_names","title":"Replace Expression Value with Name — replace_values_by_names","text":"Replace Expression Value Name","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"replace_values_by_names(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace Expression Value with Name — replace_values_by_names","text":"expressions list expressions","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace Expression Value with Name — replace_values_by_names","text":"list expressions","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/replace_values_by_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace Expression Value with Name — replace_values_by_names","text":"","code":"library(rlang) replace_values_by_names(exprs(AVAL, ADT = convert_dtc_to_dt(EXSTDTC))) #> [[1]] #> AVAL #> #> $ADT #> ADT #>"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrap a String in Single Quotes — squote","title":"Wrap a String in Single Quotes — squote","text":"Wrap String Single Quotes","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrap a String in Single Quotes — squote","text":"","code":"squote(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrap a String in Single Quotes — squote","text":"x character vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/squote.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrap a String in Single Quotes — squote","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":null,"dir":"Reference","previous_headings":"","what":"Suppress Specific Warnings — suppress_warning","title":"Suppress Specific Warnings — suppress_warning","text":"Suppress certain warnings issued expression.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Suppress Specific Warnings — suppress_warning","text":"","code":"suppress_warning(expr, regexpr)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Suppress Specific Warnings — suppress_warning","text":"expr Expression executed regexpr Regular expression matching warnings suppress","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Suppress Specific Warnings — suppress_warning","text":"Return value expression","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/suppress_warning.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Suppress Specific Warnings — suppress_warning","text":"warnings issued expression match regular expression suppressed.","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":null,"dir":"Reference","previous_headings":"","what":"Valid Time Units — valid_time_units","title":"Valid Time Units — valid_time_units","text":"Contains acceptable character vector valid time units","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Valid Time Units — valid_time_units","text":"","code":"valid_time_units()"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/valid_time_units.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Valid Time Units — valid_time_units","text":"character vector valid time units","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":null,"dir":"Reference","previous_headings":"","what":"Turn a List of Expressions into a Character Vector — vars2chr","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"Turn List Expressions Character Vector","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"vars2chr(expressions)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"expressions list expressions created using exprs()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"character vector","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/vars2chr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Turn a List of Expressions into a Character Vector — vars2chr","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) vars2chr(exprs(USUBJID, AVAL)) #> #> \"USUBJID\" \"AVAL\""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn if incomplete dtc — warn_if_incomplete_dtc","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"Warn incomplete dtc","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"","code":"warn_if_incomplete_dtc(dtc, n)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"dtc character vector date-times ISO 8601 format n non-negative integer","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_incomplete_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn if incomplete dtc — warn_if_incomplete_dtc","text":"warning dtc contains partial dates","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"Checks two list inputs names number elements issues warning otherwise.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"warn_if_inconsistent_list(base, compare, list_name, i = 2)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"base named list compare named list list_name string name list index id compare 2 lists","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"warning 2 lists different names length","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_inconsistent_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If Two Lists are Inconsistent — warn_if_inconsistent_list","text":"","code":"library(dplyr, warn.conflicts = FALSE) library(rlang) # no warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) # warning warn_if_inconsistent_list( base = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ, DTHVAR = \"text\"), compare = exprs(DTHDOM = \"DM\", DTHSEQ = DMSEQ), list_name = \"Test\" ) #> Warning: The variables used for traceability in `Test` are not consistent, please check: #> source 1 , Variables are given as: DTHDOM DTHSEQ DTHVAR #> source 2 , Variables are given as: DTHDOM DTHSEQ"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"Warn vector contains unknown datetime format \"2003-12-15T-:15:18\", \"2003-12-15T13:-:19\",\"–12-15\",\"—–T07:15\"","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"warn_if_invalid_dtc(dtc, is_valid = is_valid_dtc(dtc))"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"dtc character vector containing dates is_valid logical vector indicating whether elements dtc valid","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_invalid_dtc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Vector Contains Unknown Datetime Format — warn_if_invalid_dtc","text":"","code":"## No warning as `dtc` is a valid date format warn_if_invalid_dtc(dtc = \"2021-04-06\") ## Issues a warning warn_if_invalid_dtc(dtc = \"2021-04-06T-:30:30\")"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Warn If a Variable Already Exists — warn_if_vars_exist","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"Warn variable already exists inside dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"warn_if_vars_exist(dataset, vars)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"dataset data.frame vars character vector columns check dataset","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"return value, called side effects","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/warn_if_vars_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Warn If a Variable Already Exists — warn_if_vars_exist","text":"","code":"library(dplyr, warn.conflicts = FALSE) dm <- tribble( ~USUBJID, ~ARM, \"01-701-1015\", \"Placebo\", \"01-701-1016\", \"Placebo\", ) ## No warning as `AAGE` doesn't exist in `dm` warn_if_vars_exist(dm, \"AAGE\") ## Issues a warning warn_if_vars_exist(dm, \"ARM\") #> Warning: Variable \"ARM\" already exists in the dataset."},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":null,"dir":"Reference","previous_headings":"","what":"What Kind of Object is This? — what_is_it","title":"What Kind of Object is This? — what_is_it","text":"Returns string describing kind object input .","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(x)"},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"What Kind of Object is This? — what_is_it","text":"x R object","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"What Kind of Object is This? — what_is_it","text":"character description type x","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/reference/what_is_it.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"What Kind of Object is This? — what_is_it","text":"","code":"what_is_it(\"abc\") #> Warning: `what_is_it()` was deprecated in admiraldev 1.1.0. #> ℹ This function was primarily used in error messaging, and can be replaced with #> 'cli' functionality: `cli::cli_abort('{.obj_type_friendly {letters}}')`. #> [1] \"`\\\"abc\\\"`\" what_is_it(1L) #> [1] \"`1`\" what_is_it(1:10) #> [1] \"an integer vector\" what_is_it(mtcars) #> [1] \"a data frame\""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-development-version","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev (development version)","text":"following function arguments entering next phase deprecation process: (#2487) (#2595) Phase 1 (message) Phase 2 (warning) Phase 3 (error) Phase 4 (removed)","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-1-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 1.2.0","text":"New Function deprecate_inform() wrapper around lifecycle::deprecate_soft() allow control messaging. (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-2-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.2.0","text":"Objects passed assert_list_element() via ... argument can now used glue expression specified message_text argument. (#469) required_unit argument assert_unit() enhanced. now possible specify one unit specify . latter case uniqueness unit checked. (#468) assert_numeric_vector() function gained optional length argument check whether vector specific length. (#473)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.2.0","text":"admiraldev compatible R version >=4.1 (#456) following function arguments entering next phase deprecation process: (#459) Phase 1 (message) functions arguments Phase Phase 2 (warning) functions arguments Phase Phase 3 (error) functions arguments Phase Phase 4 (removed) argument quosures removed functions vars2chr(quosures), replace_values_by_names(quosures), get_source_vars(quosures) Removed v1.0.0 assert_named_expr() Removed v1.0.0 assert_has_variables() Removed v1.0.0 assert_function_param()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.2.0","text":"Deprecation Strategy updated long haul! (#466)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-1-2-0","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev 1.2.0","text":"devcontainer files removed (#480)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-110","dir":"Changelog","previous_headings":"","what":"admiraldev 1.1.0","title":"admiraldev 1.1.0","text":"CRAN release: 2024-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.1.0","text":"Updated arg_name parameter assert_filter_cond, assert_symbol, assert_expr gsub(\"^enexpr\\\\((\\\\w+)\\\\)$\", \"\\\\1\", rlang::caller_arg(arg)) argument error messages return quoted argument without enexpr(), e.g. filter_add instead enexpr(filter_add). (#2404) Error messaging throughout package updated rlang::abort() cli::cli_abort(). part update, assert_*() functions new arguments assert_*(message, arg_name, call, class). (#367) Warning messaging also updated use cli messaging.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.1.0","text":"renv related files removed. (#360) longer exporting is_named() function. (#401) pharmaversesdtm removed dependency. (#434) part error messaging update, following changes made. assert_s3_class(class) argument renamed assert_s3_class(cls). (#367) Functions arg_name(), enumerate(), what_is_it(), friendly_type_of() deprecated warning returned developer using functions. developer functions (opposed functions typical admiral users), use short deprecation cycle.","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.1.0","text":"“Release Strategy” vignette updated respect new branching strategy. (#353) “Release Strategy” vignette now contains short new “Release Tracking” section linking external dashboard CRAN packages awaiting release. (#358)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"other-1-1-0","dir":"Changelog","previous_headings":"","what":"Other","title":"admiraldev 1.1.0","text":"Removed dependencies needed build package package documentation. (#426) Increased minimum R version required 4.0 match {admiral}. (#382) addin_format_testthat addin moved {pharmaverse4devs} package. (#419)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-100","dir":"Changelog","previous_headings":"","what":"admiraldev 1.0.0","title":"admiraldev 1.0.0","text":"CRAN release: 2023-12-15","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-1-0-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 1.0.0","text":"assert_function() now accepts function arguments ellipsis, ... function formals (#339)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-1-0-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 1.0.0","text":"assert_function_param() assert_named_expr() assert_has_variables()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-1-0-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 1.0.0","text":"New documentation programming strategy around quoting/expressions standardizing roxygen texts (#233, #332) New documentation use footnotes writing vignettes (#324) Updated language images adopt GitHub Flow Strategy (#349)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-050","dir":"Changelog","previous_headings":"","what":"admiraldev 0.5.0","title":"admiraldev 0.5.0","text":"CRAN release: 2023-09-11","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-5-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.5.0","text":"Calls admiral.test swapped pharmaversesdtm (#321) New vignette package writing extensions now available (#295, #312) New vignette creating test data now available (#282)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-5-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.5.0","text":"messaging warn_if_invalid_dtc() updated align date/datetime functions admiral currently . (#316)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.5.0","text":"assert_order_vars() quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names(), get_source_vars(), vars2chr(). (#288) assert_function_param() deprecated favor assert_function(). (#264) assert_named_expr() deprecated favor assert_expr_list(). (#264) assert_has_variables() deprecated favor assert_data_frame(). (#264)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-5-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.5.0","text":"Guidance around issues merging updated (#286) Common R CMD troubleshooting made separate vignette (#286) Documentation get_dataset() improved. (#271) Minor updates programming strategy added (#213, #240, #260) Updated unit testing vignette snapshot testing guidance. (#302) Documentation friendly_type_of() provided (#22) Minor updates pull request review guidance added (#201, #292) Documentation singular versus plural function argument names added programming strategy vignette. Also documentation common arguments missing_value missing_values added. (#296) Documentation highlighting difference set_values_to keep_source_vars (#318) List common arguments updated (#306)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-040","dir":"Changelog","previous_headings":"","what":"admiraldev 0.4.0","title":"admiraldev 0.4.0","text":"CRAN release: 2023-06-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-4-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.4.0","text":"New function assert_named() check elements argument named (#241) New function assert_expr_list() check argument list expressions (#241) Added Report bug link admiraldev website (#257)","code":""},{"path":[]},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-4-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.4.0","text":"assert_order_vars() deprecated favor assert_expr_list(). (#241) following functions deprecated previous admiral versions using next phase deprecation process: (#272) quo_c() quo_not_missing() replace_symbol_in_quo() quosures argument replaced expressions argument replace_values_by_names().","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-4-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.4.0","text":"deprecation strategy updated regarding unit tests deprecated functions/arguments phase 1. (#247) programming strategy updated regarding permitted values calling functions package dependencies (#72, #253)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-030","dir":"Changelog","previous_headings":"","what":"admiraldev 0.3.0","title":"admiraldev 0.3.0","text":"CRAN release: 2023-03-06","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-3-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.3.0","text":"New function process_set_values_to() creating variables specified set_value_to argument catching errors (#70)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-3-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.3.0","text":"Using testthat3e (testthat 3rd edition) unit testing. stricter messages must addressed deprecated functions throw errors. (#230) Slight boost test coverage dev_utilities (#102) Fix datatable styling documentation (#197) assert_character_vector() function gained named argument check elements vector named. (#70) assert_list_of() function gained named argument check elements list named. (#203) quote_fun argument enumerate() extended NULL can specified request quoting elements. (#203) assert_list_of() function enhanced also considers type element, e.g., check value list symbols. (#208)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-3-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.3.0","text":"default value optional argument assert_date_vector(), assert_list_of(), assert_s3_class() changed TRUE FALSE make default behavior consistent. (#87) quo_c() replace_symbol_in_quo() quosures argument get_source_vars(), replace_values_by_names(), vars2chr()","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-3-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.3.0","text":"New section programming strategy regarding comments (#71) Removed requirement add @author tags code scripts programming strategy, tracking authors DESCRIPTION file. Authors removed function documentation line update. (#206, #210) Removed -boarding Issue Template (#225) Increased clarity scope package (#232)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-020","dir":"Changelog","previous_headings":"","what":"admiraldev 0.2.0","title":"admiraldev 0.2.0","text":"CRAN release: 2022-11-30","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.2.0","text":"Developer addin formatting tests admiral programming standards (#73) New functions replace_symbol_in_quo() add_suffix_to_vars() (#106) New function assert_atomic_vector() (#98) New keyword/family create_aux functions creating auxiliary datasets (#126) New function assert_date_vector() (#129) New function assert_same_type() (#176) Remove dependency {assertthat} (#149) Test coverage admiraldev increased 45% approximately 100% (#94, #95, #96, #98, #101, #103) Environment objects consolidated single admiraldev_environment object R/admiraldev_environment.R. (#179)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.2.0","text":"expect_names argument added assert_vars() check variables named (#117) Remove dplyr function exports migration user facing function negate_vars() admiral (#83)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.2.0","text":"longer compatible admiral (<0.9)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-2-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.2.0","text":"New vignette package release strategy (#79) Updated multiple roxygen headers (#116, #133, #134, #141, #145, #172) Description admiral options work certain function inputs, .e subject_keys (#133)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-2-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.2.0","text":"PR Checklist Template updated (#172) New authors/contributors (#158)","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"admiraldev-010","dir":"Changelog","previous_headings":"","what":"admiraldev 0.1.0","title":"admiraldev 0.1.0","text":"CRAN release: 2022-08-26","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"new-features-0-1-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"admiraldev 0.1.0","text":"Developer specific functions brought admiral Developer specific vignettes brought admiral New admiraldev website created","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"updates-of-existing-functions-0-1-0","dir":"Changelog","previous_headings":"","what":"Updates of Existing Functions","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"breaking-changes-0-1-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"documentation-0-1-0","dir":"Changelog","previous_headings":"","what":"Documentation","title":"admiraldev 0.1.0","text":"NA","code":""},{"path":"https://pharmaverse.github.io/admiraldev/dev/news/index.html","id":"various-0-1-0","dir":"Changelog","previous_headings":"","what":"Various","title":"admiraldev 0.1.0","text":"NA","code":""}]