diff --git a/dev/LICENSE-text.html b/dev/LICENSE-text.html index e97b0bc4..2ea1cf8b 100644 --- a/dev/LICENSE-text.html +++ b/dev/LICENSE-text.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/LICENSE.html b/dev/LICENSE.html index 57c52e96..2e0fc484 100644 --- a/dev/LICENSE.html +++ b/dev/LICENSE.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/articles/agency_standards.html b/dev/articles/agency_standards.html index 15344c12..6508d845 100644 --- a/dev/articles/agency_standards.html +++ b/dev/articles/agency_standards.html @@ -34,7 +34,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/articles/deepdive.html b/dev/articles/deepdive.html index e13f122d..b4ebabb5 100644 --- a/dev/articles/deepdive.html +++ b/dev/articles/deepdive.html @@ -34,7 +34,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 @@ -408,8 +408,8 @@ Setting up our metadata objectdataset_spec <- dataset_spec %>% rename(label = "Description") %>% rename_with(tolower) - - + + diff --git a/dev/articles/index.html b/dev/articles/index.html index c398f6b3..adc723cf 100644 --- a/dev/articles/index.html +++ b/dev/articles/index.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/articles/xportr.html b/dev/articles/xportr.html index a5727446..79944a8a 100644 --- a/dev/articles/xportr.html +++ b/dev/articles/xportr.html @@ -34,7 +34,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 @@ -135,8 +135,8 @@ Getting Started with xportr# Loading in our example data data("adsl_xportr", package = "xportr") - - + + Preparing your Specification Files @@ -160,8 +160,8 @@ Preparing your Specification FilesADSL data set, which we will make use of in the 6 xportr function calls below. Take note of the order, label, type, length and format columns. - - + + xportr_type() @@ -589,8 +589,8 @@ xportr_order() `DTHADY`, `REGION1`, `TRTDURD`, `LDDTHELD`, `LSTALVDT`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, `DTHB30FL`, `FRVDT`, `RANDDT`, `SCRFDT`, `EOSDT`, and `EOSSTT` - - + + xportr_format() diff --git a/dev/authors.html b/dev/authors.html index 00519593..86443663 100644 --- a/dev/authors.html +++ b/dev/authors.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 @@ -118,14 +118,14 @@ Citation Miller E, Straub B, Zhu Z, Brockmann E, Viyash V, Verissimo A, Shapcott S, Piraux C, Zhang K, Chan A, Mascary S (2024). xportr: Utilities to Output CDISC SDTM/ADaM XPT Files. -R package version 0.3.1.9032, +R package version 0.3.1.9033, https://github.com/atorus-research/xportr, https://atorus-research.github.io/xportr/. @Manual{, title = {xportr: Utilities to Output CDISC SDTM/ADaM XPT Files}, author = {Eli Miller and Ben Straub and Zelos Zhu and Ethan Brockmann and Vedha Viyash and Andre Verissimo and Sophie Shapcott and Celine Piraux and Kangjie Zhang and Adrian Chan and Sadchla Mascary}, year = {2024}, - note = {R package version 0.3.1.9032, + note = {R package version 0.3.1.9033, https://github.com/atorus-research/xportr}, url = {https://atorus-research.github.io/xportr/}, } diff --git a/dev/index.html b/dev/index.html index 8efc4841..20b8209d 100644 --- a/dev/index.html +++ b/dev/index.html @@ -36,7 +36,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/news/index.html b/dev/news/index.html index d57ea318..336e2a7b 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 @@ -63,51 +63,52 @@ xportr (development version) -New Features and Bug Fixes -xportr_metadata() can set verbose for a whole pipeline, i.e. setting verbose in xportr_metadata() will populate to all xportr functions. (#151) -All xportr functions now have verbose = NULL as the default (#151) -Bug fix for domain filtering (#137) +New Features +All core functions can be run together by using new function xportr() (#137) + +xportr_metadata() can set verbose for a whole pipeline, i.e. setting verbose in xportr_metadata() will populate to all xportr functions. (#151) + +xportr_split() is a new function that allows users to split a dataset into multiple output files based on a variable. (#183) + +xportr_write() now accepts metadata argument which can be used to set the dataset label to stay consistent with the other xportr_* functions. It is noteworthy that the dataset label set using the xportr_df_label() function will be retained during the xportr_write(). (#179) +Added a check for character variable lengths up to 200 bytes in xpt_validate()(#91, #189). +File name check is moved to strict_checks condition to allow underscores in the file name. Underscores are allowed in xpt but not per FDA requirements. (#126) +It is now possible to get and set the xportr options using the helper function xportr_options() (#130) +Added xportr.character_metadata_types and xportr.numeric_metadata_types to list the metadata types that are character or numeric. Updated xportr.character_types and xportr.numeric_types to list only the R types that are character and the R types that are numeric. This ensures that all R types, including dates, are now managed by xportr_type. If the R type differs from the metadata type, the variable is coerced (#161). +New argument in xportr_length() allows selection between the length from metadata, as previously done, or from the calculated maximum length per variable when length_source is set to “data” (#91) +Series of basic checks added to the xportr_format() function to ensure format lengths, prefixes are accurate for the variable type. Also to ensure that any numeric date/datetime/time variables have a format. (#164) + +xportr_length() assigns the maximum length value instead of 200 for a character variable when the length is missing in the metadata (#207) -Documentation -Remove unused packages from Suggests (#221) -xportr_write() now accepts metadata argument which can be used to set the dataset label to stay consistent with the other xportr_* functions. It is noteworthy that the dataset label set using the xportr_df_label() function will be retained during the xportr_write(). -Exporting a new dataset dataset_spec that contains the Dataset Specification for ADSL. (#179) -Added a check for character variable lengths up to 200 bytes in xpt_validate()(#91, #189). -File name check is moved to strict_checks condition to allow underscores in the file name. Underscores are allowed in xpt but not per FDA requirements. (#126) -It is now possible to get and set the xportr options using the helper function xportr_options() (#130) -Added xportr.character_metadata_types and xportr.numeric_metadata_types to list the metadata types that are character or numeric. Updated xportr.character_types and xportr.numeric_types to list only the R types that are character and the R types that are numeric. This ensures that all R types, including dates, are now managed by xportr_type. If the R type differs from the metadata type, the variable is coerced (#161).. -Adds argument assertions to public functions using checkmate (#175) -xportr_split() is a new function that allows users to split a dataset into multiple output files based on a variable. (#183) -xportr_metadata() can set verbose for a whole pipeline, i.e. setting verbose in xportr_metadata() will populate to all xportr functions. (#151) -All xportr functions now have verbose = NULL as the default. If left NULL, the previous default of getOption("xportr.[fn_name]_verbose") is used (#151) -All core functions can be run together by using new function xportr() (#137) -New argument in xportr_length() allows selection between the length from metadata, as previously done, or from the calculated maximum length per variable when length_source is set to “data” (#91) -Series of basic checks added to the xportr_format() function to ensure format lengths, prefixes are accurate for the variable type. Also to ensure that any numeric date/datetime/time variables have a format. (#164) -Make xportr_type() drop factor levels when coercing variables -xportr_length() assigns the maximum length value instead of 200 for a character variable when the length is missing in the metadata (#207) +Bug Fixes +Bug fix for domain filtering (#137) +Make xportr_type() drop factor levels when coercing variables (#159) Deprecation and Breaking Changes -The domain argument for xportr functions will no longer be dynamically determined by the name of the data frame passed as the .df argument. This was done to make the use of xportr functions more explicit. (#182) -The label argument from the xportr_write() function is deprecated in favor of the metadata argument. (#179) -The metacore argument, which was renamed to metadata in the following six xportr functions: (xportr_df_label(), xportr_format(), xportr_label(), xportr_length(), xportr_order(), and xportr_type()) in version 0.3.0 with a soft deprecation warning, has now been hard deprecated. Please update your code to use the new metadata argument in place of metacore. -SASlength and SAStype were removed since they did not have an impact on xpt_validate or any other functions (#132) -Removes admiral from suggested dependencies (#237) -adsl data object is now called adsl_xportr (#237) -Data objects are no longer lazy loaded, which means that when needed the user must call data("name_of_object") first (#237) +The domain argument for xportr functions will no longer be dynamically determined by the name of the data frame passed as the .df argument. This was done to make the use of xportr functions more explicit. (#182) +The metacore argument, which was renamed to metadata in the following six xportr functions: (xportr_df_label(), xportr_format(), xportr_label(), xportr_length(), xportr_order(), and xportr_type()) in version 0.3.0 with a soft deprecation warning, has now been hard deprecated. Please update your code to use the new metadata argument in place of metacore. (#203) + +SASlength and SAStype were removed since they did not have an impact on xpt_validate or any other functions (#132) + +adsl data object is now called adsl_xportr (#237) -Documentation -Created development version of the website (#187) -Additional guidance for options added in deep dive vignette (#81) -Added a vignette about standards in different agencies (#206) -Removed non-user facing function documentation (#192) -Added more details about xportr_length() and xportr() to deep dive vignette (#215, #222) +Documentation +Created development version of the website (#187) +Additional guidance for options added in deep dive vignette (#81) +Added a vignette about standards in different agencies (#206) +Removed non-user facing function documentation (#192) +Added more details about xportr_length() and xportr() to deep dive vignette (#215, #222) Miscellaneous Tests use withr to create temporary files that are automatically deleted (#219) +Remove unused packages from Suggests (#221, #237) +Exporting a new dataset dataset_spec that contains the Dataset Specification for ADSL. (#179) +Adds argument assertions to public functions using checkmate (#175) +Data objects are no longer lazy loaded, which means that when needed the user must call data("name_of_object") first (#237) diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index ab382d79..e7c37a71 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -5,7 +5,7 @@ articles: agency_standards: agency_standards.html deepdive: deepdive.html xportr: xportr.html -last_built: 2024-03-22T16:27Z +last_built: 2024-03-25T20:48Z urls: reference: https://atorus-research.github.io/xportr/reference article: https://atorus-research.github.io/xportr/articles diff --git a/dev/pull_request_template.html b/dev/pull_request_template.html index f7b4923a..07f5c8cf 100644 --- a/dev/pull_request_template.html +++ b/dev/pull_request_template.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/adsl_xportr.html b/dev/reference/adsl_xportr.html index 745a17a2..22c951da 100644 --- a/dev/reference/adsl_xportr.html +++ b/dev/reference/adsl_xportr.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/dataset_spec.html b/dev/reference/dataset_spec.html index cdc16b27..3574b83e 100644 --- a/dev/reference/dataset_spec.html +++ b/dev/reference/dataset_spec.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/expect_attr_width.html b/dev/reference/expect_attr_width.html index 455e152b..9ffe7d43 100644 --- a/dev/reference/expect_attr_width.html +++ b/dev/reference/expect_attr_width.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/index.html b/dev/reference/index.html index e3f7a3d5..6c60b56c 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/metadata.html b/dev/reference/metadata.html index 4b847e32..895af427 100644 --- a/dev/reference/metadata.html +++ b/dev/reference/metadata.html @@ -18,7 +18,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/minimal_metadata.html b/dev/reference/minimal_metadata.html index 84477277..d1454806 100644 --- a/dev/reference/minimal_metadata.html +++ b/dev/reference/minimal_metadata.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/minimal_table.html b/dev/reference/minimal_table.html index 6204d8cd..b8b3c405 100644 --- a/dev/reference/minimal_table.html +++ b/dev/reference/minimal_table.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/multiple_vars_in_spec_helper.html b/dev/reference/multiple_vars_in_spec_helper.html index e6f3146f..136e81c1 100644 --- a/dev/reference/multiple_vars_in_spec_helper.html +++ b/dev/reference/multiple_vars_in_spec_helper.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/multiple_vars_in_spec_helper2.html b/dev/reference/multiple_vars_in_spec_helper2.html index 7d521804..b3d0a80d 100644 --- a/dev/reference/multiple_vars_in_spec_helper2.html +++ b/dev/reference/multiple_vars_in_spec_helper2.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/var_spec.html b/dev/reference/var_spec.html index 87f45b20..afec2f08 100644 --- a/dev/reference/var_spec.html +++ b/dev/reference/var_spec.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr-package.html b/dev/reference/xportr-package.html index f84a4fd8..f94995b2 100644 --- a/dev/reference/xportr-package.html +++ b/dev/reference/xportr-package.html @@ -20,7 +20,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr.html b/dev/reference/xportr.html index c0cb4f2e..57649319 100644 --- a/dev/reference/xportr.html +++ b/dev/reference/xportr.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_df_label.html b/dev/reference/xportr_df_label.html index d3fc7e4f..a2b04803 100644 --- a/dev/reference/xportr_df_label.html +++ b/dev/reference/xportr_df_label.html @@ -12,7 +12,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_format.html b/dev/reference/xportr_format.html index c1ec2b4b..67e18c23 100644 --- a/dev/reference/xportr_format.html +++ b/dev/reference/xportr_format.html @@ -14,7 +14,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_label.html b/dev/reference/xportr_label.html index db231790..d22c0979 100644 --- a/dev/reference/xportr_label.html +++ b/dev/reference/xportr_label.html @@ -18,7 +18,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_length.html b/dev/reference/xportr_length.html index 83038f90..e0de2680 100644 --- a/dev/reference/xportr_length.html +++ b/dev/reference/xportr_length.html @@ -16,7 +16,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_options.html b/dev/reference/xportr_options.html index 380ccfa6..26c8f73a 100644 --- a/dev/reference/xportr_options.html +++ b/dev/reference/xportr_options.html @@ -22,7 +22,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_options_list.html b/dev/reference/xportr_options_list.html index e4e4f597..ba4c5137 100644 --- a/dev/reference/xportr_options_list.html +++ b/dev/reference/xportr_options_list.html @@ -10,7 +10,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_order.html b/dev/reference/xportr_order.html index f6a5e80e..c5af03e0 100644 --- a/dev/reference/xportr_order.html +++ b/dev/reference/xportr_order.html @@ -14,7 +14,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_split.html b/dev/reference/xportr_split.html index 337b1bef..f2a7dbf3 100644 --- a/dev/reference/xportr_split.html +++ b/dev/reference/xportr_split.html @@ -18,7 +18,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_type.html b/dev/reference/xportr_type.html index 6e7fe4df..5556f5da 100644 --- a/dev/reference/xportr_type.html +++ b/dev/reference/xportr_type.html @@ -20,7 +20,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xportr_write.html b/dev/reference/xportr_write.html index b2118ee8..b38eb823 100644 --- a/dev/reference/xportr_write.html +++ b/dev/reference/xportr_write.html @@ -14,7 +14,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/reference/xpt_validate.html b/dev/reference/xpt_validate.html index c7122ace..0065544a 100644 --- a/dev/reference/xpt_validate.html +++ b/dev/reference/xpt_validate.html @@ -12,7 +12,7 @@ xportr - 0.3.1.9032 + 0.3.1.9033 diff --git a/dev/search.json b/dev/search.json index 6c059a60..2f8b0a2e 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":"https://atorus-research.github.io/xportr/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2021 Atorus/GSK JPT Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"motivation","dir":"Articles","previous_headings":"","what":"Motivation","title":"Standards in Different Regulatory Agencies","text":"xportr package designed help clinical programmers create CDISC compliant xpt files. provides functionality associate metadata information local R data frame, perform data set level validation checks, convert transport v5 file (xpt). However, technical requirements related xpt files can change across different regulatory agencies. vignette aims start provide clear concise summary differences agencies xpt files. updates come later package releases. following section delve various technical specifications per FDA, NMPA, PMDA guidelines.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt","dir":"Articles","previous_headings":"Motivation > File name - character","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"first character must English letter (, B, C, . . ., Z) underscore (_). Subsequent characters can letters, numeric digits (0, 1, . . ., 9), underscores. can use uppercase lowercase letters. Blanks appear SAS names. Special characters, except underscore, allowed.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda","dir":"Articles","previous_headings":"Motivation > File name - character","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"Dataset transport file named transport file. Variable names, well variable dataset labels include American Standard Code Information Interchange (ASCII) text codes . Dataset names contain lowercase letters, numbers, must start letter.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa","dir":"Articles","previous_headings":"Motivation > File name - character","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"file name dataset name must SDTM ADaM datasets. Japanese dataset alphanumeric dataset must identical structure, except data lengths Japanese items corresponding alphanumeric character sequence","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda","dir":"Articles","previous_headings":"Motivation > File name - character","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-1","dir":"Articles","previous_headings":"Motivation > File name - length","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"maximum length 8 bytes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-1","dir":"Articles","previous_headings":"Motivation > File name - length","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"8 characters","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-1","dir":"Articles","previous_headings":"Motivation > File name - length","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-1","dir":"Articles","previous_headings":"Motivation > File name - length","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-2","dir":"Articles","previous_headings":"Motivation > Variable name","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"name can contain letters Latin alphabet, numerals, underscores. name contain blanks special characters except underscore. name must begin letter Latin alphabet (–Z, –z) underscore.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-2","dir":"Articles","previous_headings":"Motivation > Variable name","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"Variable names, well variable dataset labels include American Standard Code Information Interchange (ASCII) text codes . Variable names contain uppercase letters, numbers, must start letter","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-2","dir":"Articles","previous_headings":"Motivation > Variable name","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"Japanese dataset alphanumeric dataset must identical structure, except data lengths Japanese items corresponding alphanumeric character sequence","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-2","dir":"Articles","previous_headings":"Motivation > Variable name","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-3","dir":"Articles","previous_headings":"Motivation > Variable length","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"8 bytes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-3","dir":"Articles","previous_headings":"Motivation > Variable length","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"8 characters","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-3","dir":"Articles","previous_headings":"Motivation > Variable length","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-3","dir":"Articles","previous_headings":"Motivation > Variable length","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-4","dir":"Articles","previous_headings":"Motivation > Label character","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-4","dir":"Articles","previous_headings":"Motivation > Label character","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"Variable names, well variable dataset labels include American Standard Code Information Interchange (ASCII) text codes . submit study data following special characters variable dataset labels: 1. Unbalanced apostrophe, e.g., “Parkinson’s” 2. Unbalanced single double quotation marks 3. Unbalanced parentheses, braces brackets, e.g.,(, {[","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-4","dir":"Articles","previous_headings":"Motivation > Label character","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"Japanese dataset alphanumeric dataset must identical structure, except data lengths Japanese items corresponding alphanumeric character sequence","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-4","dir":"Articles","previous_headings":"Motivation > Label character","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"eSubmission China, one requirements translate foreign language data package (e.g., English) Chinese. Variable labels, dataset labels, MedDRA, Drug terms, primary endpoint-related code lists, etc., need translated English Chinese.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-5","dir":"Articles","previous_headings":"Motivation > Label length","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"40 bytes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-5","dir":"Articles","previous_headings":"Motivation > Label length","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"40 characters","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-5","dir":"Articles","previous_headings":"Motivation > Label length","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-5","dir":"Articles","previous_headings":"Motivation > Label length","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-6","dir":"Articles","previous_headings":"Motivation > Values character","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-6","dir":"Articles","previous_headings":"Motivation > Values character","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"Variable values broadly compatible software operating systems restricted ASCII text codes (printable values 128). Use UTF-8 extending character sets; however, use extended mappings recommended. Transcoding errors, variable length errors, lack software support multi byte UTF-8 encodings can result incorrect character display variable value truncation.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-6","dir":"Articles","previous_headings":"Motivation > Values character","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"variables collected Japanese risk losing certain information translating English, descriptions Japanese necessary appropriate, data written Japanese (hereinafter referred Japanese data) may submitted. Japanese dataset, Japanese items Japanese rest alphanumeric(=ASCII) data, similar alphanumeric dataset.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-6","dir":"Articles","previous_headings":"Motivation > Values character","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"eSubmission China, one requirements translate foreign language data package (e.g., English) Chinese. Variable labels, dataset labels, MedDRA, Drug terms, primary endpoint-related code lists, etc., need translated English Chinese.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-7","dir":"Articles","previous_headings":"Motivation > Values length","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"200 bytes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-7","dir":"Articles","previous_headings":"Motivation > Values length","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"allotted length column containing character (text) data set maximum length variable used across datasets study except supplementary qualification datasets.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-7","dir":"Articles","previous_headings":"Motivation > Values length","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-7","dir":"Articles","previous_headings":"Motivation > Values length","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-8","dir":"Articles","previous_headings":"Motivation > Format","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"SAS format","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-8","dir":"Articles","previous_headings":"Motivation > Format","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"SAS format","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-8","dir":"Articles","previous_headings":"Motivation > Format","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-8","dir":"Articles","previous_headings":"Motivation > Format","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-9","dir":"Articles","previous_headings":"Motivation > Type","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"Numeric character","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-9","dir":"Articles","previous_headings":"Motivation > Type","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-9","dir":"Articles","previous_headings":"Motivation > Type","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-9","dir":"Articles","previous_headings":"Motivation > Type","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-10","dir":"Articles","previous_headings":"Motivation > File size","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-10","dir":"Articles","previous_headings":"Motivation > File size","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"5 GB","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-10","dir":"Articles","previous_headings":"Motivation > File size","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"consulted sponsors datasets >= 5 GB requirement split datasets","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-10","dir":"Articles","previous_headings":"Motivation > File size","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Deep Dive into xportr","text":"vignette explore detail possibilities xportr package applying information metadata object R created dataset using core xportr functions. also explore following: goes Submission Health Authority, role xportr play Submission? xportr validating behind scenes? Breakdown xportr ADaM dataset specification file. Using options() xportr_metadata() enhance xportr experience. Understanding warning error messages xportr function. brief discussion future work. NOTE: use phrase metadata object throughout package. metadata object can either specification file read R dataframe metacore object. metadata object created via metacore package additional features covered , core using specification file. However, xportr work either dataframe metacore object.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"what-goes-in-a-submission-to-a-health-authority","dir":"Articles","previous_headings":"","what":"What goes in a Submission to a Health Authority?","title":"Deep Dive into xportr","text":"Quite bit! focus data deliverables supporting documentation needed successful submission Health Authority xportr can play key role. briefly look three parts: Study Data Standardization Plan SDTM Data Package ADaM Data Package","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"study-data-standardization-plan","dir":"Articles","previous_headings":"What goes in a Submission to a Health Authority?","what":"Study Data Standardization Plan","title":"Deep Dive into xportr","text":"Study Data Standardization Plan (SDSP) establishes documents plan describing data standardization approach clinical nonclinical studies within development program. SDSP also assists FDA identifying potential data standardization issues early development program. hope brevity section belie huge importance document. Please see Study Data Standardisation Plan (SDSP) Package maintained PHUSE working group. However, want focus actual data xportr can play role submission.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"sdtm-and-adam-data-packages","dir":"Articles","previous_headings":"What goes in a Submission to a Health Authority?","what":"SDTM and ADaM Data Packages","title":"Deep Dive into xportr","text":"SDTM: primary pieces SDTM package SDTM annotated case report forms (acrf.pdf), data definitions document (define.xml), Study Data Reviewer’s Guide (sdrg.pdf) datasets xpt Version 5 format. Version 5 xpt file required submission format datasets going Health Authorities. ADaM: key components ADaM package similar SDTM package additions: define.xml, Analysis Study Data Reviewer’s Guide (adrg.pdf), Analysis Results Metadata (analysis-results-metadata.pdf) datasets Version 5 xpt format. Data Packages need compliant xpt files, feel xportr can play pivotal role . core functions xportr can used apply information metadata object datasets giving users feedback quality metadata data. xportr_write() can used write final dataset xpt file, can submitted Health Authority.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"what-is-xportr-validating-in-these-data-packages","dir":"Articles","previous_headings":"What goes in a Submission to a Health Authority?","what":"What is {xportr} validating in these Data Packages?","title":"Deep Dive into xportr","text":"xpt Version 5 files form backbone successful Submission govern quite lot rules suggested guidelines. preparing data packages submission suite core xportr functions, plus xportr_write(), helps check datasets submission compliant. package checks many latest rules laid Study Data Technical Conformance Guide, please note yet exhaustive list checks. envision users also submitting xpts metadata additional validation software. core xportr functions applying labels, types, formats, order lengths provides feedback users submission compliance. However, final check implemented xportr_write() called create xpt. xportr_write() calls xpt_validate(), behind scenes/non-exported function final check compliance. time {xportr} v0.3.0 checking following user writes xpt file.:","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr-in-action","dir":"Articles","previous_headings":"","what":"{xportr} in action","title":"Deep Dive into xportr","text":"section, going explore 5 core xportr functions using: data(\"adsl_xportr\", package = \"xportr\") - ADSL ADaM dataset Pilot 3 Submission FDA data(\"var_spec\", package = \"xportr\") - ADSL ADaM Specification File Pilot 3 Submission FDA focus warning error messaging contrived examples functions manipulating either datasets specification files. NOTE: made ADSL Spec available package. Users can find additional datasets specification files repo example_data_specs folder. keep package minimum size.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"using-options-and-xportr_metadata-to-enhance-your-experience-","dir":"Articles","previous_headings":"{xportr} in action","what":"Using options() and xportr_metadata() to enhance your experience.","title":"Deep Dive into xportr","text":"dive functions, want point quality life utilities make xpt generation life little bit easier. options() xportr_options() xportr_metadata() NOTE: long well-defined metadata object need use options() xportr_metadata(), find handy use think deserve quick mention!","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"youve-got-options-or-xportr_options","dir":"Articles","previous_headings":"{xportr} in action","what":"You’ve got options() or xportr_options()","title":"Deep Dive into xportr","text":"xportr built certain assumptions around specification column names information columns. found company specification file can differ slightly assumptions. example, one company might call column Variables, another Variable another variables. Rather trying regex situation, introduced options(). options() allows users control assumptions inside xportr functions based needs. Additionally, helper function xportr_options() works just like options() , can also used get current state xportr options. Let’s take look example specification file names available package. can see columns start upper case letter spaces several . convert column names lower case deal spacing using dplyr functions base R, just use options()! using options() xportr_options() beginning script can tell xportr valid names (see chunk ). Please note set options package assumed every thing lowercase spaces names. running options() xportr_options(), xportr sees column Variable valid name rather variable. can inspect xportr_options function docs look additional options.","code":"library(xportr) library(dplyr) library(haven) data(\"adsl_xportr\", \"var_spec\", \"dataset_spec\", package = \"xportr\") colnames(var_spec) [1] \"Order\" \"Dataset\" \"Variable\" [4] \"Label\" \"Data Type\" \"Length\" [7] \"Significant Digits\" \"Format\" \"Mandatory\" [10] \"Assigned Value\" \"Codelist\" \"Common\" [13] \"Origin\" \"Pages\" \"Method\" [16] \"Predecessor\" \"Role\" \"Comment\" [19] \"Developer Notes\" ADSL <- adsl_xportr xportr_options( xportr.variable_name = \"Variable\", xportr.label = \"Label\", xportr.type_name = \"Data Type\", xportr.format = \"Format\", xportr.length = \"Length\", xportr.order_name = \"Order\" ) # Or alternatively options( xportr.variable_name = \"Variable\", xportr.label = \"Label\", xportr.type_name = \"Data Type\", xportr.format = \"Format\", xportr.length = \"Length\", xportr.order_name = \"Order\" )"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"are-we-being-too-verbose","dir":"Articles","previous_headings":"{xportr} in action","what":"Are we being too verbose?","title":"Deep Dive into xportr","text":"One final note options. 4 core xportr functions ability set messaging \"none\", \"message\", \"warn\", \"stop\". Setting calls can bit repetitive. can use options() xportr_options() set higher level avoid repetition.","code":"# Default verbose is set to `none` xportr_options( xportr.format_verbose = \"none\", xportr.label_verbose = \"none\", xportr.length_verbose = \"none\", xportr.type_verbose = \"none\" ) xportr_options( xportr.format_verbose = \"none\", # Disables any messaging, keeping the console output clean xportr.label_verbose = \"message\", # Sends a standard message to the console xportr.length_verbose = \"warn\", # Sends a warning message to the console xportr.type_verbose = \"stop\" # Stops execution and sends an error message to the console )"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"going-meta","dir":"Articles","previous_headings":"{xportr} in action","what":"Going meta","title":"Deep Dive into xportr","text":"core xportr functions requires several inputs: valid dataframe, metadata object domain name, along optional messaging. example, simple call using functions. can see, lot information repeated call. help reduce repetitive calls, created xportr_metadata(). user can just set metadata object Domain name first call, passed functions. Much cleaner!","code":"ADSL %>% xportr_type(var_spec, \"ADSL\", \"message\") %>% xportr_length(var_spec, \"ADSL\", verbose = \"message\") %>% xportr_label(var_spec, \"ADSL\", \"message\") %>% xportr_order(var_spec, \"ADSL\", \"message\") %>% xportr_format(var_spec, \"ADSL\") %>% xportr_df_label(dataset_spec, \"ADSL\") %>% xportr_write(\"adsl.xpt\") ADSL %>% xportr_metadata(var_spec, \"ADSL\") %>% xportr_type() %>% xportr_length(length_source = \"metadata\") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(\"adsl.xpt\")"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"warnings-and-errors","dir":"Articles","previous_headings":"{xportr} in action","what":"Warnings and Errors","title":"Deep Dive into xportr","text":"next six sections, going explore Warnings Errors messages generated xportr core functions. better explore , either manipulate ADaM dataset specification file help showcase ability xportr functions detect issues. NOTE: made ADSL, xportr::adsl, Specification File, xportr::var_spec, available package. Users can find additional datasets specification files repo example_data_specs folder.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"setting-up-our-metadata-object","dir":"Articles","previous_headings":"{xportr} in action > Warnings and Errors","what":"Setting up our metadata object","title":"Deep Dive into xportr","text":"First, let’s read specification file call var_spec. Note using options() . slight manipulation column names lower case, changing Data Type type making Order column numeric. can also use options() step well. var_spec object five dataset specification files stacked top . make use ADSL subset var_spec. can make use Search field dataset column subset specification file ADSL Similarly, can read Dataset spec file call dataset_spec.","code":"var_spec <- var_spec %>% rename(type = \"Data Type\") %>% rename_with(tolower) dataset_spec <- dataset_spec %>% rename(label = \"Description\") %>% rename_with(tolower)"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_type","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_type()","title":"Deep Dive into xportr","text":"going explore type column metadata object. submission Health Authority character numeric types data. ADSL data several columns Date type: TRTSDT, TRTEDT, SCRFDT, EOSDT, FRVDT, RANDDT, DTHDT, LSTALVDT - hood actually numeric values left . change one variable type factor variable, common data structure R, give us educational opportunities see xportr_type() action. Success! can see , xportr_type() applied types metadata object STUDYID variables converting proper type. functions xportr also display coercion user console, seen . Note xportr_type(verbose = \"warn\") set function provided feedback, show console, variables converted warning message. However, can set verbose = \"stop\" types applied data match specification file. Using verbose = \"stop\" instantly stop processing function create object. user need alter variables R script using xportr_type()","code":"adsl_fct <- ADSL %>% mutate(STUDYID = as_factor(STUDYID)) Rows: 306 Columns: 9 $ STUDYID CDISCPILOT01, CDISCPILOT01, CDISCPILOT01, CDISCPILOT01, CDISC… $ TRTSDT 2014-01-02, 2012-08-05, 2013-07-19, 2014-03-18, 2014-07-01, … $ TRTEDT 2014-07-02, 2012-09-01, 2014-01-14, 2014-03-31, 2014-12-30, … $ SCRFDT NA, NA, NA, NA, NA, NA, 2013-12-20, NA, NA, NA, NA, NA, NA, … $ EOSDT 2014-07-02, 2012-09-02, 2014-01-14, 2014-04-14, 2014-12-30, … $ FRVDT NA, 2013-02-18, NA, 2014-09-15, NA, 2013-07-28, NA, NA, 2013… $ RANDDT 2014-01-02, 2012-08-05, 2013-07-19, 2014-03-18, 2014-07-01, … $ DTHDT NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, … $ LSTALVDT 2014-07-02, 2012-09-02, 2014-01-14, 2014-04-14, 2014-12-30, … adsl_type <- xportr_type(.df = adsl_fct, metadata = var_spec, domain = \"ADSL\", verbose = \"warn\") ── Variable type mismatches found. ── ✔ 1 variables coerced Warning: Variable type(s) in dataframe don't match metadata: `STUDYID` glimpse(adsl_type_glimpse) Rows: 306 Columns: 9 $ STUDYID \"CDISCPILOT01\", \"CDISCPILOT01\", \"CDISCPILOT01\", \"CDISCPILOT01… $ TRTSDT 2014-01-02, 2012-08-05, 2013-07-19, 2014-03-18, 2014-07-01, … $ TRTEDT 2014-07-02, 2012-09-01, 2014-01-14, 2014-03-31, 2014-12-30, … $ SCRFDT NA, NA, NA, NA, NA, NA, 2013-12-20, NA, NA, NA, NA, NA, NA, … $ EOSDT 2014-07-02, 2012-09-02, 2014-01-14, 2014-04-14, 2014-12-30, … $ FRVDT NA, 2013-02-18, NA, 2014-09-15, NA, 2013-07-28, NA, NA, 2013… $ RANDDT 2014-01-02, 2012-08-05, 2013-07-19, 2014-03-18, 2014-07-01, … $ DTHDT NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, … $ LSTALVDT 2014-07-02, 2012-09-02, 2014-01-14, 2014-04-14, 2014-12-30, … adsl_type <- xportr_type(.df = adsl_fct, metadata = var_spec, domain = \"ADSL\", verbose = \"stop\") ── Variable type mismatches found. ── ✔ 1 variables coerced Error in `xportr_logger()` at xportr/R/messages.R:98:5: ! Variable type(s) in dataframe don't match metadata: `STUDYID`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_length","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_length()","title":"Deep Dive into xportr","text":"two sources length (data-driven spec-driven): Data-driven length: max length character columns 8 data types Spec-driven length: metadata Users can either specify length metadata leave blank data-driven length. length missing metadata, data-driven length applied. Next use xportr_length() apply length column metadata object ADSL dataset. Using str() function displayed variables attributes. can see variable label, information lengths variable. Using xportr_length() verbose = \"warn\" can apply length column columns dataset. function detects two variables, TRTDUR DCREASCD missing metadata file. Note variables slight misspellings dataset metadata, great catch! However, lengths still applied TRTDUR give length 8 DCREASCD length 200. Using str() function, can see xportr_length() successfully applied lengths variable variables dataset. Just like xportr_type(), setting verbose = \"stop\" immediately stops R processing lengths. function detects missing variables apply lengths dataset corrective action applied.","code":"tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_length <- xportr_length( .df = ADSL, metadata = var_spec, domain = \"ADSL\", verbose = \"warn\", length_source = \"metadata\" ) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` Warning: Variable(s) present in dataframe but doesn't exist in `metadata`.Problem with `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" ..- attr(*, \"width\")= num 12 $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" ..- attr(*, \"width\")= num 11 $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" ..- attr(*, \"width\")= num 4 $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" ..- attr(*, \"width\")= num 20 $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" ..- attr(*, \"width\")= num 20 $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" ..- attr(*, \"width\")= num 10 $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" ..- attr(*, \"width\")= num 10 $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" ..- attr(*, \"width\")= num 0 $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" ..- attr(*, \"width\")= num 16 $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" ..- attr(*, \"width\")= num 10 $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" ..- attr(*, \"width\")= num 1 $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" ..- attr(*, \"width\")= num 3 $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" ..- attr(*, \"width\")= num 8 $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" ..- attr(*, \"width\")= num 5 $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" ..- attr(*, \"width\")= num 1 $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" ..- attr(*, \"width\")= num 32 $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" ..- attr(*, \"width\")= num 22 $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" ..- attr(*, \"width\")= num 8 $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"width\")= num 20 $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" ..- attr(*, \"width\")= num 8 $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"width\")= num 20 $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" ..- attr(*, \"width\")= num 3 $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" ..- attr(*, \"width\")= num 10 $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" ..- attr(*, \"width\")= num 8 $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"width\")= num 20 $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"width\")= num 20 $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"width\")= num 1 $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"width\")= num 1 $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"width\")= num 8 $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"width\")= num 12 $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 0 $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"width\")= num 8 $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"width\")= num 8 $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"width\")= num 1 $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"width\")= num 9 $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"width\")= num 5 $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"width\")= num 2 $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 5 $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 1 $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 0 $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 1 - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\" adsl_length <- xportr_length( .df = ADSL, metadata = var_spec, domain = \"ADSL\", verbose = \"stop\", length_source = \"metadata\" ) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` Error in `xportr_logger()` at xportr/R/messages.R:119:5: ! Variable(s) present in dataframe but doesn't exist in `metadata`.Problem with `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_label","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_label()","title":"Deep Dive into xportr","text":"creating dataset R often find R removes label variable. Using xportr_label() can easily re-apply labels variables one quick action. example, going manipulate metadata ADSL dataset: metadata variable TRTSDT label greater 40 characters. ADSL dataset labels stripped . Remember length example, labels original dataset seen str() output. successfully removed labels. Using xportr_label() apply labels metadata dataset. Please note using verbose = \"warn\" two issues TRTDUR DCREASCD reported missing metadata file. additional message sent around TRTSDT label length greater 40. Success! labels applied present metadata dataset. However, please note TRTSDT variable label characters greater 40 applied dataset TRTDUR DCREASCD empty variable labels. Just like functions, setting verbose = \"stop\" immediately stops R processing labels. function detects mismatches variables labels well label greater 40 characters. stops process, none labels applied dataset corrective action applied.","code":"var_spec_lbl <- var_spec %>% mutate(label = if_else(variable == \"TRTSDT\", \"Length of variable label must be 40 characters or less\", label )) adsl_lbl <- ADSL adsl_lbl <- haven::zap_label(ADSL) tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... $ RFICDTC : chr [1:306] NA NA NA NA ... $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... $ DTHDTC : chr [1:306] NA NA NA NA ... $ DTHFL : chr [1:306] NA NA NA NA ... $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_lbl <- xportr_label(.df = adsl_lbl, metadata = var_spec_lbl, domain = \"ADSL\", verbose = \"warn\") ── Variable labels missing from metadata. ── ✔ 30 labels skipped Warning: Variable(s) present in dataframe but doesn't exist in `metadata`. ✖ Problem with `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` Warning: Length of variable label must be 40 characters or less. ✖ Problem with `TRTSDT`. tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Died?\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Planned Treatment for Period 01\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Actual Treatment for Period 01\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"label\")= chr \"\" $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"label\")= chr \"\" $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"label\")= chr \"Total Treatment Duration (Days)\" $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"label\")= chr \"End of Study Status\" $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"label\")= chr \"Safety Population Flag\" $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"label\")= chr \"\" $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"label\")= chr \"Pooled Age Group 1\" $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"label\")= chr \"\" $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\" adsl_label <- xportr_label(.df = adsl_lbl, metadata = var_spec_lbl, domain = \"ADSL\", verbose = \"stop\") ── Variable labels missing from metadata. ── ✔ 30 labels skipped Error in `xportr_logger()` at xportr/R/messages.R:144:5: ! Variable(s) present in dataframe but doesn't exist in `metadata`. ✖ Problem with `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_order","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_order()","title":"Deep Dive into xportr","text":"order dataset can greatly increase readability dataset downstream stakeholders. example, treatment related variables analysis variables grouped together can help inspection understanding dataset. xportr_order() can take order information metadata apply dataset. Readers encouraged inspect dataset metadata see past order updated order calling function. Note messaging xportr_order(): Variables metadata moved end Variables order re-ordered message printed ones re-ordered. Just like functions, setting verbose = \"stop\" immediately stops R processing order. variables metadata missing either, re-ordering process corrective action performed.","code":"adsl_ord <- xportr_order(.df = ADSL, metadata = var_spec, domain = \"ADSL\", verbose = \"warn\") ── 30 variables not in spec and moved to end ── Warning: Variable moved to end in `.df`: `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` ── 42 reordered in dataset ── Warning: Variable reordered in `.df`: `SITEID`, `ARM`, `TRT01P`, `TRT01A`, `TRTSDT`, `TRTEDT`, `TRTDURD`, `AGE`, `AGEGR1`, `AGEU`, `RACE`, `ETHNIC`, `SAFFL`, `DTHFL`, `RFSTDTC`, `RFENDTC`, `EOSSTT`, `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, and `RACEGR1` adsl_ord <- xportr_order(.df = ADSL, metadata = var_spec, domain = \"ADSL\", verbose = \"stop\") ── 30 variables not in spec and moved to end ── Error in `xportr_logger()` at xportr/R/messages.R:171:5: ! Variable moved to end in `.df`: `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_format","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_format()","title":"Deep Dive into xportr","text":"Formats play important role SAS language column specification files. able easily apply formats xpt file allow downstream users SAS quickly format data appropriately reading SAS-based system. xportr_format() can take formats apply . Please reference xportr_length() xportr_label() note missing attr() formats ADSL dataset. example slightly different previous examples. need use xportr_type() coerce R Date variables others types character numeric. can use xportr_format() apply format column dataset. Success! taken metadata formats applied dataset. Please inspect variables like TRTSDT DISONSDT see DATE9. format applied. time {xportr} v0.3.0 implemented warnings error messaging function. However, xportr_write() xpt_validate() check formats applied valid SAS formats.","code":"adsl_fmt <- ADSL %>% xportr_type(metadata = var_spec, domain = \"ADSL\", verbose = \"warn\") %>% xportr_format(metadata = var_spec, domain = \"ADSL\") tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" ..- attr(*, \"format.sas\")= chr \"\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" ..- attr(*, \"format.sas\")= chr \"\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" ..- attr(*, \"format.sas\")= chr \"\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" ..- attr(*, \"format.sas\")= chr \"\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" ..- attr(*, \"format.sas\")= chr \"\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" ..- attr(*, \"format.sas\")= chr \"\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" ..- attr(*, \"format.sas\")= chr \"\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" ..- attr(*, \"format.sas\")= chr \"\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" ..- attr(*, \"format.sas\")= chr \"\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" ..- attr(*, \"format.sas\")= chr \"\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" ..- attr(*, \"format.sas\")= chr \"\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" ..- attr(*, \"format.sas\")= chr \"\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" ..- attr(*, \"format.sas\")= chr \"\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" ..- attr(*, \"format.sas\")= chr \"\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" ..- attr(*, \"format.sas\")= chr \"\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" ..- attr(*, \"format.sas\")= chr \"\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" ..- attr(*, \"format.sas\")= chr \"\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" ..- attr(*, \"format.sas\")= chr \"\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"format.sas\")= chr \"\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" ..- attr(*, \"format.sas\")= chr \"\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"format.sas\")= chr \"\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" ..- attr(*, \"format.sas\")= chr \"\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" ..- attr(*, \"format.sas\")= chr \"\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" ..- attr(*, \"format.sas\")= chr \"\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"format.sas\")= chr \"\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"format.sas\")= chr \"\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"format.sas\")= chr \"\" $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"format.sas\")= chr \"\" $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"format.sas\")= chr \"\" $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"format.sas\")= chr \"\" $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"format.sas\")= chr \"\" $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"format.sas\")= chr \"\" $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"format.sas\")= chr \"\" $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"format.sas\")= chr \"\" $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_write","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_write()","title":"Deep Dive into xportr","text":"Finally, want write xpt dataset metadata applied. make use xportr_metadata() reduce repetitive metadata domain specifications. use default option verbose, just message set anything verbose. xportr_write() specify path, just current working directory, set dataset label toggle strict_checks FALSE. also note worthy can set dataset label using xportr_df_label dataset_spec used xportr_write() Success! applied types, lengths, labels, ordering formats dataset. Note messages written console. Remember TRTDUR DCREASCD present metadata, dataset. impacts messaging lengths labels xportr printing feedback us two issues. 5 types coerced, well 36 variables re-ordered. Note strict_checks set FALSE. next two examples showcase strict_checks = TRUE option xportr_write() look formats labels. several ---DT type variables, xportr_write() detects lack formats applied. correct remember can use xportr_type() xportr_format() apply formats xpt dataset. manipulated labels greater 40 characters TRTSDT. turned xportr_label() verbose options produce message. However, xportr_write() strict_checks = TRUE error one many xpt_validate() checks going behind scenes.","code":"ADSL %>% xportr_metadata(var_spec, \"ADSL\") %>% xportr_type() %>% xportr_length(length_source = \"metadata\") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = \"adsl.xpt\", strict_checks = FALSE) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` ── Variable labels missing from metadata. ── ✔ 30 labels skipped ── 30 variables not in spec and moved to end ── ── 42 reordered in dataset ── ADSL %>% xportr_write(path = \"adsl.xpt\", metadata = dataset_spec, domain = \"ADSL\", strict_checks = TRUE) var_spec_lbl <- var_spec %>% mutate(label = if_else(variable == \"TRTSDT\", \"Length of variable label must be 40 characters or less\", label )) ADSL %>% xportr_metadata(var_spec_lbl, \"ADSL\") %>% xportr_label() %>% xportr_type() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = \"adsl.xpt\", strict_checks = TRUE) ── Variable labels missing from metadata. ── ✔ 30 labels skipped Warning: Length of variable label must be 40 characters or less. ✖ Problem with `TRTSDT`. Error in `xportr_write()`: ! The following validation checks failed: • Label 'TRTSDT=Length of variable label must be 40 characters or less' must be 40 characters or less."},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr()","title":"Deep Dive into xportr","text":"many functions call? Simplify xportr(). bundles core xportr functions writing xpt. xportr() equivalent calling following functions individually:","code":"xportr( ADSL, var_metadata = var_spec, df_metadata = dataset_spec, domain = \"ADSL\", verbose = \"none\", path = \"adsl.xpt\" ) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` ── Variable labels missing from metadata. ── ✔ 30 labels skipped ── 30 variables not in spec and moved to end ── ── 42 reordered in dataset ── ADSL %>% xportr_metadata(var_spec, \"ADSL\") %>% xportr_type() %>% xportr_length(length_source = \"metadata\") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = \"adsl.xpt\", strict_checks = FALSE) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` ── Variable labels missing from metadata. ── ✔ 30 labels skipped ── 30 variables not in spec and moved to end ── ── 42 reordered in dataset ──"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"future-work","dir":"Articles","previous_headings":"{xportr} in action","what":"Future Work","title":"Deep Dive into xportr","text":"xportr still undergoing development. hope produce vignettes functions allow users bulk process multiple datasets well examples piping xpt files related documentation validation software service. always, please let us know feature requests, documentation updates bugs GitHub repo.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"getting-started-with-xportr","dir":"Articles","previous_headings":"","what":"Getting Started with xportr","title":"Getting Started","text":"demo make use small ADSL dataset available xportr package following features: 306 observations 51 variables Data types character numeric Missing labels variables Missing label data set Order variables following specification file Formats missing create fully compliant v5 xpt ADSL dataset, developed using R, need apply 6 main functions within xportr package: xportr_type() xportr_length() xportr_order() xportr_format() xportr_label() xportr_write()","code":"# Loading packages library(dplyr) library(labelled) library(xportr) library(readxl) # Loading in our example data data(\"adsl_xportr\", package = \"xportr\")"},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"preparing-your-specification-files","dir":"Articles","previous_headings":"","what":"Preparing your Specification Files","title":"Getting Started","text":"order make use functions within xportr need create R data frame contains specification file. likely need pre-processing spec sheets loading spec files work appropriately xportr functions. Please see example spec sheets system.file(file.path(\"specs\", \"ADaM_spec.xlsx\"), package = \"xportr\") see xportr expects specification sheets. quick snapshot specification file pertaining ADSL data set, make use 6 xportr function calls . Take note order, label, type, length format columns.","code":"var_spec <- read_xlsx( system.file(file.path(\"specs/\", \"ADaM_spec.xlsx\"), package = \"xportr\"), sheet = \"Variables\" ) %>% rename(type = \"Data Type\") %>% rename_with(tolower)"},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_type","dir":"Articles","previous_headings":"","what":"xportr_type()","title":"Getting Started","text":"NOTE: make use str() expose attributes (length, labels, formats, type) datasets. suppressed calls sake brevity. order compliant transport v5 specifications xpt file can two data types: character numeric/dbl. Currently ADSL data set chr, dbl, time, factor date. Using xportr_type() supplied specification file, can coerce variables ADSL set either numeric character. Now appropriate types applied dataset seen .","code":"tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_type <- xportr_type(adsl_xportr, var_spec, domain = \"ADSL\", verbose = \"message\") tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\""},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_length","dir":"Articles","previous_headings":"","what":"xportr_length()","title":"Getting Started","text":"Next can apply lengths variable level specification file data frame. xportr_length() identify variables missing specification file. function also alert many lengths applied successfully. apply lengths lets verify lengths applied original dataframe. lengths applied variables seen printout - lengths attr() part variables. Let’s now use xportr_length() apply lengths specification file. Note additional attr(*, \"width\")= variable width. directly applied specification file loaded !","code":"tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_length <- adsl_xportr %>% xportr_length(var_spec, domain = \"ADSL\", verbose = \"message\") tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" ..- attr(*, \"width\")= num 21 $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" ..- attr(*, \"width\")= num 30 $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" ..- attr(*, \"width\")= num 8 $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" ..- attr(*, \"width\")= num 19 $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" ..- attr(*, \"width\")= num 19 $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" ..- attr(*, \"width\")= num 19 $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" ..- attr(*, \"width\")= num 19 $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" ..- attr(*, \"width\")= num 19 $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" ..- attr(*, \"width\")= num 19 $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" ..- attr(*, \"width\")= num 19 $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" ..- attr(*, \"width\")= num 2 $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" ..- attr(*, \"width\")= num 5 $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" ..- attr(*, \"width\")= num 8 $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" ..- attr(*, \"width\")= num 10 $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" ..- attr(*, \"width\")= num 1 $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" ..- attr(*, \"width\")= num 60 $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" ..- attr(*, \"width\")= num 100 $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" ..- attr(*, \"width\")= num 20 $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"width\")= num 200 $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" ..- attr(*, \"width\")= num 20 $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"width\")= num 200 $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" ..- attr(*, \"width\")= num 3 $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" ..- attr(*, \"width\")= num 19 $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" ..- attr(*, \"width\")= num 8 $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"width\")= num 40 $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"width\")= num 40 $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"width\")= num 2 $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"width\")= num 2 $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"width\")= num 8 $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"width\")= num 200 $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 2 $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"width\")= num 8 $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"width\")= num 8 $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"width\")= num 2 $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"width\")= num 200 $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"width\")= num 20 $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"width\")= num 80 $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 200 $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 200 $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 200 $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 200 - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\""},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_order","dir":"Articles","previous_headings":"","what":"xportr_order()","title":"Getting Started","text":"Please note order ADSL variables, see , match specification file order column. can quickly remedy call xportr_order(). Note variable SITEID moved well many others match specification file order column. Variables spec moved end data message written console.","code":"adsl_order <- xportr_order(adsl_xportr, var_spec, domain = \"ADSL\", verbose = \"message\") ── All variables in specification file are in dataset ── ── 50 reordered in dataset ── Variable reordered in `.df`: `SITEID`, `USUBJID`, `SUBJID`, `COUNTRY`, `AGE`, `AGEU`, `AGEGR1`, `SEX`, `RACE`, `RACEGR1`, `ETHNIC`, `RFSTDTC`, `RFENDTC`, `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DMDTC`, `DMDY`, `SAFFL`, `ARM`, `ARMCD`, `ACTARM`, `ACTARMCD`, `TRT01P`, `TRT01A`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `TRTSDT`, `TRTEDT`, `DTHFL`, `DTHDTC`, `DTHDT`, `DTHDTF`, `DTHADY`, `REGION1`, `TRTDURD`, `LDDTHELD`, `LSTALVDT`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, `DTHB30FL`, `FRVDT`, `RANDDT`, `SCRFDT`, `EOSDT`, and `EOSSTT`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_format","dir":"Articles","previous_headings":"","what":"xportr_format()","title":"Getting Started","text":"Now apply formats dataset. typically DATE9., DATETIME20 TIME5, many others can used. Notice ADSL dataset 8 Date/Time variables missing formats. just take peak TRT variables, NULL format. Using xportr_format() can apply formats dataset. NOTE: can use attr(data$variable, = \"format\") inspect formats applied dataframe. output individual calls bound together easier viewing.","code":"# A tibble: 4 × 2 Variable Format 1 TRTSDT 2 TRTEDT 3 TRTSDTM 4 TRTEDTM adsl_fmt <- adsl_xportr %>% xportr_format(var_spec, domain = \"ADSL\") # A tibble: 4 × 2 Variable Format 1 TRTSDT DATE9. 2 TRTEDT DATE9. 3 TRTSDTM DATETIME20. 4 TRTEDTM DATETIME20."},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_label","dir":"Articles","previous_headings":"","what":"xportr_label()","title":"Getting Started","text":"Please observe ADSL dataset missing many variable labels. Sometimes labels can lost using R’s function. However, CDISC compliant data set needs variable label. Using xport_label function can take specifications file label variables available. xportr_label produce warning message variable data set specification file.","code":"tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... $ RFICDTC : chr [1:306] NA NA NA NA ... $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... $ DTHDTC : chr [1:306] NA NA NA NA ... $ DTHFL : chr [1:306] NA NA NA NA ... $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_lbl <- adsl_xportr %>% xportr_label(var_spec, domain = \"ADSL\", \"message\") str(adsl_lbl) tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date / Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Planned Treatment for Period 01\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Actual Treatment for Period 01\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"label\")= chr \"Time of First Exposure Imputation Flag\" $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"label\")= chr \"Time of Last Exposure Imputation Flag\" $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"label\")= chr \"Total Duration of Trt (days)\" $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"label\")= chr \"End of Study Status\" $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date of Death Imputation Flag\" $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"label\")= chr \"Relative Day of Death\" $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"label\")= chr \"Elapsed Days from Last Dose to Death\" $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"label\")= chr \"Safety Population Flag\" $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"label\")= chr \"Pooled Race Group 1\" $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"label\")= chr \"Pooled Age Group 1\" $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"label\")= chr \"Geographic Region 1\" $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Last Does to Death Group\" $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Under 30 Group\" $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Over 30 Group\" $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Over 30 plus 30 days Group\" - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\""},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_write","dir":"Articles","previous_headings":"","what":"xportr_write()","title":"Getting Started","text":"Finally, arrive exporting R data frame object xpt file xportr_write(). xpt file written directly current working directory. make interesting, put together six functions magrittr pipe, %>%. user can now apply types, length, variable labels, formats, data set label write final xpt file one pipe! Appropriate warnings messages supplied user console potential issues sending standard clinical data set validator application data reviewers. ’s ! now xpt file created R appropriate types, lengths, labels, ordering formats specification file. interested exploring custom warnings error messages well background xpt generation sure check Deep Dive User Guide. always, welcome feedback. spot bug, like see new feature, documentation unclear - submit issue xportr’s GitHub page.","code":"adsl_xportr %>% xportr_type(var_spec, \"ADSL\", \"message\") %>% xportr_length(var_spec, \"ADSL\", verbose = \"message\") %>% xportr_label(var_spec, \"ADSL\", \"message\") %>% xportr_order(var_spec, \"ADSL\", \"message\") %>% xportr_format(var_spec, \"ADSL\") %>% xportr_write(\"adsl.xpt\") ── All variables in specification file are in dataset ── ── 50 reordered in dataset ── Variable reordered in `.df`: `SITEID`, `USUBJID`, `SUBJID`, `COUNTRY`, `AGE`, `AGEU`, `AGEGR1`, `SEX`, `RACE`, `RACEGR1`, `ETHNIC`, `RFSTDTC`, `RFENDTC`, `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DMDTC`, `DMDY`, `SAFFL`, `ARM`, `ARMCD`, `ACTARM`, `ACTARMCD`, `TRT01P`, `TRT01A`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `TRTSDT`, `TRTEDT`, `DTHFL`, `DTHDTC`, `DTHDT`, `DTHDTF`, `DTHADY`, `REGION1`, `TRTDURD`, `LDDTHELD`, `LSTALVDT`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, `DTHB30FL`, `FRVDT`, `RANDDT`, `SCRFDT`, `EOSDT`, and `EOSSTT`"},{"path":"https://atorus-research.github.io/xportr/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Eli Miller. Author, maintainer. Ben Straub. Author. Zelos Zhu. Author. Ethan Brockmann. Author. Vedha Viyash. Author. Andre Verissimo. Author. Sophie Shapcott. Author. Celine Piraux. Author. Kangjie Zhang. Author. Adrian Chan. Author. Sadchla Mascary. Author. Atorus/GSK JPT. Copyright holder.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Miller E, Straub B, Zhu Z, Brockmann E, Viyash V, Verissimo , Shapcott S, Piraux C, Zhang K, Chan , Mascary S (2024). xportr: Utilities Output CDISC SDTM/ADaM XPT Files. R package version 0.3.1.9032, https://github.com/atorus-research/xportr, https://atorus-research.github.io/xportr/.","code":"@Manual{, title = {xportr: Utilities to Output CDISC SDTM/ADaM XPT Files}, author = {Eli Miller and Ben Straub and Zelos Zhu and Ethan Brockmann and Vedha Viyash and Andre Verissimo and Sophie Shapcott and Celine Piraux and Kangjie Zhang and Adrian Chan and Sadchla Mascary}, year = {2024}, note = {R package version 0.3.1.9032, https://github.com/atorus-research/xportr}, url = {https://atorus-research.github.io/xportr/}, }"},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"xportr-","dir":"","previous_headings":"","what":"Utilities to Output CDISC SDTM/ADaM XPT Files","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"Welcome xportr! designed xportr help get xpt files ready transport either clinical data set validator application regulatory agency. package functionality associate metadata information local R data frame, perform data set level validation checks convert transport v5 file(xpt). always, welcome feedback. spot bug, like see new feature, documentation unclear - submit issue xportr’s GitHub page.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"package available CRAN can installed running:","code":"install.packages(\"xportr\")"},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"development-version","dir":"","previous_headings":"Installation","what":"Development version:","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"","code":"install.packages(\"xportr\", repos = c(\"https://pharmaverse.r-universe.dev\", getOption(\"repos\")))"},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"what-is-xportr","dir":"","previous_headings":"","what":"What is xportr?","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"xportr designed clinical programmers create CDISC compliant xpt files- ADaM SDTM. Essentially, package two big components Writing xpt files well-defined metadata Checking compliance data sets. first set tools designed allow clinical programmer build CDISC compliant xpt file directly R. second set tools perform checks data sets send validators data reviewers.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"what-are-the-checks","dir":"","previous_headings":"","what":"What are the checks?","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"Variable names must start letter (underscore), comprised uppercase letters (-Z), numerals (0-9) free non-ASCII characters, symbols, underscores. Allotted length column containing character (text) data set maximum length variable used across data sets (≤ 200) Coerces variables numeric character types Display format support numeric float date/time values Variables names ≤ 8 characters. Variable labels ≤ 40 characters. Data set labels ≤ 40 characters. Presence non-ASCII characters Variable Names, Labels data set labels. NOTE: check associated messages warning.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"simple-example","dir":"","previous_headings":"","what":"Simple Example","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"Objective: Create fully compliant v5 xpt ADSL dataset developed using R. need following: Apply types Apply lengths Apply variable labels Apply formats Re-order variables Apply dataset label Write version 5 xpt file can done using well-defined specification file xportr package! First start ADSL dataset created R. example ADSL dataset contains 306 observations 51 variables. created dummy specification file called ADaM_spec.xlsx found specs folder package. can use system.file(file.path(\"specs/\", \"ADaM_spec.xlsx\"), package = \"xportr\") access file. xportr_ function written way take part specification file apply piece dataset. Setting verbose = \"warn\" send appropriate warning message console. suppressed warning sake brevity. xportr_metadata() function can reduce duplication setting variable specification domain explicitly top pipeline. like use verbose argument, need set function call. Furthermore, ’re calling xportr functions common metadata verbosity, can shorten simply using xportr(). ’s ! now xpt file created R appropriate types, lengths, labels, ordering formats. Please check Get Started information detailed walk xportr_ function. talks Pharma companies involved {pharmaverse} enhance package play well downstream upstream packages.","code":"library(dplyr) library(xportr) data(\"adsl_xportr\") ADSL <- adsl_xportr spec_path <- system.file(file.path(\"specs\", \"ADaM_spec.xlsx\"), package = \"xportr\") var_spec <- readxl::read_xlsx(spec_path, sheet = \"Variables\") %>% dplyr::rename(type = \"Data Type\") %>% dplyr::rename_with(tolower) dataset_spec <- readxl::read_xlsx(spec_path, sheet = \"Datasets\") %>% dplyr::rename(label = \"Description\") %>% dplyr::rename_with(tolower) ADSL %>% xportr_metadata(var_spec, \"ADSL\") %>% xportr_type(verbose = \"warn\") %>% xportr_length(verbose = \"warn\") %>% xportr_label(verbose = \"warn\") %>% xportr_order(verbose = \"warn\") %>% xportr_format() %>% xportr_df_label(dataset_spec, \"ADSL\") %>% xportr_write(\"adsl.xpt\") ADSL %>% xportr_metadata(var_spec, \"ADSL\", verbose = \"warn\") %>% xportr_type() %>% xportr_length() %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(\"adsl.xpt\") xportr( .df = ADSL, var_metadata = var_spec, df_metadata = dataset_spec, domain = \"ADSL\", verbose = \"warn\", \"adsl.xpt\" )"},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"package developed jointly GSK Atorus.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/pull_request_template.html","id":"thank-you-for-your-pull-request","dir":"","previous_headings":"","what":"Thank you for your Pull Request!","title":"NA","text":"developed Pull Request template aid reviewers. Completing tasks helps ensure reviewers can maximize time code well making sure xportr codebase remains robust consistent.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/pull_request_template.html","id":"the-scope-of-xportr","dir":"","previous_headings":"","what":"The scope of {xportr}","title":"NA","text":"xportr’s scope enable R users write submission compliant xpt files can delivered Health Authority downstream validation software programs. see labels, lengths, types, ordering formats dataset specification object (SDTM ADaM) primary focus. also see messaging warnings users around applying information specification file primary focus. Please make sure Pull Request meets scope {xportr}. Pull Request moves beyond scope, please get touch xportr team slack create issue discuss. Please check task box acknowledgment completed task. checklist part Github Action workflows Pull Request merged main branch checked task.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/pull_request_template.html","id":"changes-description","dir":"","previous_headings":"","what":"Changes Description","title":"NA","text":"(descriptions changes)","code":""},{"path":"https://atorus-research.github.io/xportr/dev/pull_request_template.html","id":"task-list","dir":"","previous_headings":"","what":"Task List","title":"NA","text":"spirit xportr met Pull Request Place Closes # beginning Pull Request Title (Use Edit button top-right need update) Summary changes filled Changes Description. Can removed left blank changes minor/self-explanatory. Code formatted according tidyverse style guide. Use styler package functions style files accordingly. New functions arguments follow established convention found Wiki. Updated relevant unit tests written new unit tests. See Wiki conventions used package. Creation/updated relevant roxygen headers examples. See Wiki conventions used package. Run devtools::document() .Rd files man folder NAMESPACE file project root updated appropriately Run pkgdown::build_site() check affected examples displayed correctly new/updated functions occur “Reference” page. Update NEWS.md changes pertain user-facing function (.e. @export tag) documentation aimed users (rather developers) NEWS.md entry go # xportr development version section. Don’t worry updating version auto-updated using vbump.yaml CI. Address updates needed vignettes /templates. Link issue Development Panel closes successful merging. developer responsible fixing merge conflicts Reviewer. Pat back job well done! Much love accomplishment!","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/adsl_xportr.html","id":null,"dir":"Reference","previous_headings":"","what":"Analysis Dataset Subject Level — adsl_xportr","title":"Analysis Dataset Subject Level — adsl_xportr","text":"example dataset containing subject level data","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/adsl_xportr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Analysis Dataset Subject Level — adsl_xportr","text":"","code":"data(\"adsl_xportr\")"},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/reference/adsl_xportr.html","id":"adsl-xportr","dir":"Reference","previous_headings":"","what":"adsl_xportr","title":"Analysis Dataset Subject Level — adsl_xportr","text":"data frame 306 rows 51 columns: STUDYID Study Identifier USUBJID Unique Subject Identifier SUBJID Subject Identifier Study RFSTDTC Subject Reference Start Date/Time RFENDTC Subject Reference End Date/Time RFXSTDTC Date/Time First Study Treatment RFXENDTC Date/Time Last Study Treatment RFICDTC Date/Time Informed Consent RFPENDTC Date/Time End Participation DTHDTC Date/Time Death DTHFL Subject Death Flag SITEID Study Site Identifier AGE Age AGEU Age Units SEX Sex RACE Race ETHNIC Ethnicity ARMCD Planned Arm Code ARM Description Planned Arm ACTARMCD Actual Arm Code ACTARM Description Actual Arm COUNTRY Country DMDTC Date/Time Collection DMDY Study Day Collection TRT01P Planned Treatment Period 01 TRT01A Actual Treatment Period 01 TRTSDTM Datetime First Exposure Treatment TRTSTMF Time First Exposure Imputation Flag TRTEDTM Datetime Last Exposure Treatment TRTETMF Time Last Exposure Imputation Flag TRTSDT Date First Exposure Treatment TRTEDT Date Last Exposure Treatment TRTDURD Total Treatment Duration (Days) SCRFDT Screen Failure Date EOSDT End Study Date EOSSTT End Study Status FRVDT Final Retrieval Visit Date RANDDT Date Randomization DTHDT Date Death DTHDTF Date Death Imputation Flag DTHADY Relative Day Death LDDTHELD Elapsed Days Last Dose Death LSTALVDT Date Last Known Alive SAFFL Safety Population Flag RACEGR1 Pooled Race Group 1 AGEGR1 Pooled Age Group 1 REGION1 Geographic Region 1 LDDTHGR1 Last Dose Death - Days Elapsed Group 1 DTH30FL Death Within 30 Days Last Trt Flag DTHA30FL Death 30 Days Last Trt Flag DTHB30FL Death Within 30 Days First Trt Flag","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/adsl_xportr.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Analysis Dataset Subject Level — adsl_xportr","text":"Dataset created admiral::use_ad_template(\"adsl\")","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/dataset_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"Example Dataset Specification — dataset_spec","title":"Example Dataset Specification — dataset_spec","text":"Example Dataset Specification","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/dataset_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example Dataset Specification — dataset_spec","text":"","code":"data(\"dataset_spec\")"},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/reference/dataset_spec.html","id":"dataset-spec","dir":"Reference","previous_headings":"","what":"dataset_spec","title":"Example Dataset Specification — dataset_spec","text":"data frame 1 row 9 columns: Dataset Dataset Description Dataset description Class Dataset class Structure Logical, indicating specific structure Purpose Purpose dataset Key, Variables Join Key variables dataset Repeating Indicates dataset repeating Reference Data Reference Data Comment Additional comment","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/expect_attr_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Custom expect function to test result of xportr_length — expect_attr_width","title":"Custom expect function to test result of xportr_length — expect_attr_width","text":"Custom expect function test result xportr_length","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/expect_attr_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Custom expect function to test result of xportr_length — expect_attr_width","text":"","code":"expect_attr_width(result, metadata_length)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/expect_attr_width.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Custom expect function to test result of xportr_length — expect_attr_width","text":"result data.frame width attribute columns. metadata_length vector numeric expected lengths column width.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/expect_attr_width.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Custom expect function to test result of xportr_length — expect_attr_width","text":"first argument, invisibly.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Set variable specifications and domain — xportr_metadata","title":"Set variable specifications and domain — xportr_metadata","text":"Sets metadata /domain dataset way can accessed xportr functions. used start xportr pipeline, removes need set metadata domain step individually. details format metadata, see 'Metadata' section function question.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set variable specifications and domain — xportr_metadata","text":"","code":"xportr_metadata(.df, metadata = NULL, domain = NULL, verbose = NULL)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set variable specifications and domain — xportr_metadata","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none'","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set variable specifications and domain — xportr_metadata","text":".df dataset metadata domain attributes set","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set variable specifications and domain — xportr_metadata","text":"","code":"metadata <- data.frame( dataset = \"test\", variable = c(\"Subj\", \"Param\", \"Val\", \"NotUsed\"), type = c(\"numeric\", \"character\", \"numeric\", \"character\"), format = NA, order = c(1, 3, 4, 2) ) adlb <- data.frame( Subj = as.character(123, 456, 789), Different = c(\"a\", \"b\", \"c\"), Val = c(\"1\", \"2\", \"3\"), Param = c(\"param1\", \"param2\", \"param3\") ) xportr_metadata(adlb, metadata, \"test\") #> Subj Different Val Param #> 1 123 a 1 param1 #> 2 123 b 2 param2 #> 3 123 c 3 param3 library(magrittr) adlb %>% xportr_metadata(metadata, \"test\") %>% xportr_type() %>% xportr_order() #> #> ── Variable type mismatches found. ── #> #> ✔ 2 variables coerced #> #> ── 1 variables not in spec and moved to end ── #> #> ── 2 reordered in dataset ── #> #> Subj Param Val Different #> 1 123 param1 1 a #> 2 123 param2 2 b #> 3 123 param3 3 c"},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","title":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","text":"Minimal metadata data frame mock ADaM dataset","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","text":"","code":"minimal_metadata( dataset = FALSE, length = FALSE, label = FALSE, type = FALSE, format = FALSE, order = FALSE, dataset_name = \"adsl\", var_names = NULL )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","text":"dataset Flag indicates dataset column included. length Flag indicates length column included. label Flag indicates label column included. type Flag indicates type column included. format Flag indicates format column included. order Flag indicates order column included. dataset_name String name domain. var_names Character vector defines variables (rows) keep","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","text":"metadata data.frame","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Minimal data frame mock of a valid ADaM dataset — minimal_table","title":"Minimal data frame mock of a valid ADaM dataset — minimal_table","text":"function used tests.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minimal data frame mock of a valid ADaM dataset — minimal_table","text":"","code":"minimal_table(n_rows = 3, cols = c(\"x\", \"y\"))"},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minimal data frame mock of a valid ADaM dataset — minimal_table","text":"n_rows Numeric value indicates number rows data frame cols Vector characters indicates columns return. default x y returned numeric contents.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Minimal data frame mock of a valid ADaM dataset — minimal_table","text":"data.frame mimicking valid ADaM dataset.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/multiple_vars_in_spec_helper.html","id":null,"dir":"Reference","previous_headings":"","what":"Test if multiple vars in spec will result in warning message — multiple_vars_in_spec_helper","title":"Test if multiple vars in spec will result in warning message — multiple_vars_in_spec_helper","text":"Test multiple vars spec result warning message","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/multiple_vars_in_spec_helper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test if multiple vars in spec will result in warning message — multiple_vars_in_spec_helper","text":"","code":"multiple_vars_in_spec_helper(fun)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/multiple_vars_in_spec_helper2.html","id":null,"dir":"Reference","previous_headings":"","what":"Test if multiple vars in spec with appropriate — multiple_vars_in_spec_helper2","title":"Test if multiple vars in spec with appropriate — multiple_vars_in_spec_helper2","text":"Test multiple vars spec appropriate","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/multiple_vars_in_spec_helper2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test if multiple vars in spec with appropriate — multiple_vars_in_spec_helper2","text":"","code":"multiple_vars_in_spec_helper2(fun)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/var_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"Example Dataset Variable Specification — var_spec","title":"Example Dataset Variable Specification — var_spec","text":"Example Dataset Variable Specification","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/var_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example Dataset Variable Specification — var_spec","text":"","code":"data(\"var_spec\")"},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/reference/var_spec.html","id":"var-spec","dir":"Reference","previous_headings":"","what":"var_spec","title":"Example Dataset Variable Specification — var_spec","text":"data frame 216 rows 19 columns: Order Order variable Dataset Dataset Variable Variable Label Variable Label Data Type Data Type Length Variable Length Significant Digits Significant Digits Format Variable Format Mandatory Mandatory Variable Flag Assigned Value Variable Assigned Value Codelist Variable Codelist Common Common Variable Flag Origin Variable Origin Pages Pages Method Variable Method Predecessor Variable Predecessor Role Variable Role Comment Comment Developer Notes Developer Notes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr-package.html","id":null,"dir":"Reference","previous_headings":"","what":"The xportr package — xportr-package","title":"The xportr package — xportr-package","text":"xportr designed clinical workflow friendly method outputting CDISC complaint data sets R, XPT version 5 files. designed options mind allow flexible setting options allowing projects system administrators set sensible defaults organizations workflows. list options can set customize xportr works environment.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr-package.html","id":"xportr-options","dir":"Reference","previous_headings":"","what":"xportr options","title":"The xportr package — xportr-package","text":"xportr.df_domain_name - name domain \"name\" column dataset metadata. Default: \"dataset\" xportr.df_label - column noting dataset label dataset metadata. Default: \"label\" xportr.domain_name - name domain \"name\" column variable metadata. Default: \"dataset\" xportr.variable_name - name variable \"name\" variable metadata. Default: \"variable\" xportr.type_name - name variable type column variable metadata. Default: \"type\" xportr.label - name variable label column variable metadata. Default: \"label\" xportr.length - name variable length column variable metadata. Default: \"length\" xportr.order_name - name variable order column variable metadata. Default: \"order\" xportr.format_name - name variable format column variable metadata. Default: \"format\" xportr.format_verbose - default argument 'verbose' argument xportr_format. Default: \"none\" xportr.label_verbose - default argument 'verbose' argument xportr_label. Default: \"none\" xportr.length_verbose - default argument 'verbose' argument xportr_length. Default: \"none\" xportr.type_verbose - default argument 'verbose' argument xportr_type. Default: \"none\" xportr.character_types - default character vector used explicitly coerce R classes character XPT types. Default: \"character\" xportr.character_metadata_types - default character vector used explicitly coerce R classes character XPT types. Default: c(\"character\", \"char\", \"text\", \"date\", \"posixct\", \"posixt\", \"datetime\", \"time\", \"partialdate\", \"partialtime\", \"partialdatetime\", \"incompletedatetime\", \"durationdatetime\", \"intervaldatetime\")` xportr.numeric_metadata_types - default character vector used explicitly coerce R classes numeric XPT types. Default: c(\"integer\", \"numeric\", \"num\", \"float\") xportr.numeric_types - default character vector used explicitly coerce R classes numeric XPT types. Default: c(\"integer\", \"float\", \"numeric\", \"posixct\", \"posixt\", \"time\", \"date\")","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr-package.html","id":"updating-options","dir":"Reference","previous_headings":"","what":"Updating Options","title":"The xportr package — xportr-package","text":"single session, option can changed option( = ) change option single projects across sessions projects, place options update .Rprofile project directory. change option user across sessions, place options update .Rprofile file users home directory. change option users R environment, place options update .Rprofile.site file R home directory.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"The xportr package — xportr-package","text":"Maintainer: Eli Miller Eli.Miller@AtorusResearch.com (ORCID) Authors: Ben Straub Zelos Zhu Ethan Brockmann Vedha Viyash Andre Verissimo Sophie Shapcott Celine Piraux Kangjie Zhang Adrian Chan Sadchla Mascary contributors: Atorus/GSK JPT [copyright holder]","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrapper to apply all core xportr functions and write xpt — xportr","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":"Wrapper apply core xportr functions write xpt","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":"","code":"xportr( .df, var_metadata = NULL, df_metadata = NULL, domain = NULL, verbose = NULL, path, strict_checks = FALSE )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":".df data frame CDISC standard. var_metadata data frame containing variable level metadata df_metadata data frame containing dataset level metadata. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' path Path transport file written. File name sans used xpt name. strict_checks TRUE, xpt validation report errors write dataset. FALSE, xpt validation report warnings continue writing dataset. Defaults FALSE","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":"Returns input dataframe invisibly","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":"","code":"data(\"adsl_xportr\", \"dataset_spec\", \"var_spec\") adsl <- adsl_xportr library(magrittr) test_dir <- tempdir() pipeline_path <- file.path(test_dir, \"adslpipe.xpt\") xportr_path <- file.path(test_dir, \"adslxptr.xpt\") dataset_spec_low <- setNames(dataset_spec, tolower(names(dataset_spec))) names(dataset_spec_low)[[2]] <- \"label\" var_spec_low <- setNames(var_spec, tolower(names(var_spec))) names(var_spec_low)[[5]] <- \"type\" adsl %>% xportr_metadata(var_spec_low, \"ADSL\", verbose = \"none\") %>% xportr_type() %>% xportr_length() %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec_low) %>% xportr_write(pipeline_path) #> ── Variable lengths missing from metadata. ── #> #> ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` #> #> ── Variable labels missing from metadata. ── #> #> ✔ 30 labels skipped #> #> ── 30 variables not in spec and moved to end ── #> #> ── 42 reordered in dataset ── #> # `xportr()` can be used to apply a whole pipeline at once xportr( adsl, var_metadata = var_spec_low, df_metadata = dataset_spec_low, domain = \"ADSL\", verbose = \"none\", path = xportr_path ) #> ── Variable lengths missing from metadata. ── #> #> ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` #> #> ── Variable labels missing from metadata. ── #> #> ✔ 30 labels skipped #> #> ── 30 variables not in spec and moved to end ── #> #> ── 42 reordered in dataset ── #>"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign Dataset Label — xportr_df_label","title":"Assign Dataset Label — xportr_df_label","text":"Assigns dataset label dataset level metadata given data frame. stored 'label' attribute dataframe.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign Dataset Label — xportr_df_label","text":"","code":"xportr_df_label(.df, metadata = NULL, domain = NULL, metacore = deprecated())"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign Dataset Label — xportr_df_label","text":".df data frame CDISC standard. metadata data frame containing dataset. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign Dataset Label — xportr_df_label","text":"Data frame label attributes.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Assign Dataset Label — xportr_df_label","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments two columns must present: Domain Name - passed 'xportr.df_domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Label Name - passed 'xportr.df_label' option. Default: \"label\". Character values update 'label' attribute dataframe passed haven::write_xpt note label.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assign Dataset Label — xportr_df_label","text":"","code":"adsl <- data.frame( USUBJID = c(1001, 1002, 1003), SITEID = c(001, 002, 003), AGE = c(63, 35, 27), SEX = c(\"M\", \"F\", \"M\") ) metadata <- data.frame( dataset = c(\"adsl\", \"adae\"), label = c(\"Subject-Level Analysis\", \"Adverse Events Analysis\") ) adsl <- xportr_df_label(adsl, metadata, domain = \"adsl\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign SAS Format — xportr_format","title":"Assign SAS Format — xportr_format","text":"Assigns SAS format variable level metadata given data frame. format found given variable, set empty character vector. stored 'format.sas' attribute.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign SAS Format — xportr_format","text":"","code":"xportr_format( .df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign SAS Format — xportr_format","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign SAS Format — xportr_format","text":"Data frame SASformat attributes variable.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"format-checks","dir":"Reference","previous_headings":"","what":"Format Checks","title":"Assign SAS Format — xportr_format","text":"function carries series basic checks ensure formats applied make sense. Note, 'type' message generated depend value passed verbose argument: 'stop' producing error, 'warn' producing warning, 'message' producing message. value 'none' output messages. variable suffix DT, DTM, TM (indicating numeric date/time variable) message shown format associated . variable character message shown $ prefix associated format. variable character message shown associated format greater 31 characters (excluding $). variable numeric message shown $ prefix associated format. variable numeric message shown associated format greater 32 characters. formats checked list formats considered 'standard' part ADaM dataset. Note, however, list exhaustive (feasible check functions within scope package). format found 'standard' list, message created advising user check.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Assign SAS Format — xportr_format","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments three columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Format Name - passed 'xportr.format_name' option. Default: \"format\". Character values update 'format.sas' attribute column. passed haven::write note format. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assign SAS Format — xportr_format","text":"","code":"adsl <- data.frame( USUBJID = c(1001, 1002, 1003), BRTHDT = c(1, 1, 2) ) metadata <- data.frame( dataset = c(\"adsl\", \"adsl\"), variable = c(\"USUBJID\", \"BRTHDT\"), format = c(NA, \"DATE9.\") ) adsl <- xportr_format(adsl, metadata, domain = \"adsl\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign Variable Label — xportr_label","title":"Assign Variable Label — xportr_label","text":"Assigns variable label variable level metadata given data frame. function give detect label greater 40 characters allowed XPT v5. labels present variable assigned empty character value. Labels stored 'label' attribute column.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign Variable Label — xportr_label","text":"","code":"xportr_label( .df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign Variable Label — xportr_label","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign Variable Label — xportr_label","text":"Data frame label attributes variable.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"messaging","dir":"Reference","previous_headings":"","what":"Messaging","title":"Assign Variable Label — xportr_label","text":"label_log() primary messaging tool xportr_label(). columns present '.df' noted metadata, assigned label message generated noting number variables assigned label. variables found metadata value passed 'verbose' argument 'stop', 'warn', 'message', message generated detailing variables missing metadata.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Assign Variable Label — xportr_label","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments three columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata. Variable Label - passed 'xportr.label' option. Default: \"label\". character values update 'label' attribute column. passed haven::write note label.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assign Variable Label — xportr_label","text":"","code":"adsl <- data.frame( USUBJID = c(1001, 1002, 1003), SITEID = c(001, 002, 003), AGE = c(63, 35, 27), SEX = c(\"M\", \"F\", \"M\") ) metadata <- data.frame( dataset = \"adsl\", variable = c(\"USUBJID\", \"SITEID\", \"AGE\", \"SEX\"), label = c(\"Unique Subject Identifier\", \"Study Site Identifier\", \"Age\", \"Sex\") ) adsl <- xportr_label(adsl, metadata, domain = \"adsl\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign SAS Length — xportr_length","title":"Assign SAS Length — xportr_length","text":"Assigns SAS length specified data frame, either metadata object based calculated maximum data length. length present variable length value set maximum data length character columns, 8 non-character columns. value stored 'width' attribute column.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign SAS Length — xportr_length","text":"","code":"xportr_length( .df, metadata = NULL, domain = NULL, verbose = NULL, length_source = c(\"metadata\", \"data\"), metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign SAS Length — xportr_length","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' length_source Choose assigned length either metadata data. \"metadata\" specified, assigned length metadata length. \"data\" specified, assigned length determined calculated maximum data length. Permitted Values: \"metadata\", \"data\" metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign SAS Length — xportr_length","text":"Data frame SAS default length attributes variable.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"messaging","dir":"Reference","previous_headings":"","what":"Messaging","title":"Assign SAS Length — xportr_length","text":"length_log primary messaging tool xportr_length. columns present '.df' noted metadata, assigned length message generated noting number variables assigned length. variables found metadata value passed 'verbose' argument 'stop', 'warn', 'message', message generated detailing variables missing metadata.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Assign SAS Length — xportr_length","text":"argument passed 'metadata' argument can either {metacore} object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments three columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata. Variable Label - passed 'xportr.length' option. Default: \"length\". numeric values update 'width' attribute column. passed haven::write note variable length.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assign SAS Length — xportr_length","text":"","code":"adsl <- data.frame( USUBJID = c(1001, 1002, 1003), BRTHDT = c(1, 1, 2) ) metadata <- data.frame( dataset = c(\"adsl\", \"adsl\"), variable = c(\"USUBJID\", \"BRTHDT\"), length = c(10, 8) ) adsl <- xportr_length(adsl, metadata, domain = \"adsl\", length_source = \"metadata\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Get or set xportr options — xportr_options","title":"Get or set xportr options — xportr_options","text":"two mechanisms working options xportr. One options() function, part base R, xportr_options() function, xportr package. reason two mechanisms legacy code scoping. options() function sets options globally, duration R process. getOption() function retrieves value option. xportr related options type prefixed \"xportr.\".","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get or set xportr options — xportr_options","text":"","code":"xportr_options(...)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get or set xportr options — xportr_options","text":"... Options set, form name = value character vector option names.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"options-with-options-","dir":"Reference","previous_headings":"","what":"Options with options()","title":"Get or set xportr options — xportr_options","text":"xportr.df_domain_name defaults \"dataset\" xportr.df_label defaults \"label\" xportr.domain_name defaults \"dataset\" xportr.variable_name defaults \"variable\" xportr.type_name defaults \"type\" xportr.label defaults \"label\" xportr.length defaults \"length\" xportr.order_name defaults \"order\" xportr.format_name defaults \"format\" xportr.format_verbose defaults \"none\" xportr.label_verbose defaults \"none\" xportr.length_verbose defaults \"none\" xportr.type_verbose defaults \"label\" xportr.character_types defaults \"character\" xportr.character_metadata_types defaults c(\"character\", \"char\", \"text\", \"date\", \"posixct\", \"posixt\", \"datetime\", \"time\", \"partialdate\", \"partialtime\", \"partialdatetime\", \"incompletedatetime\", \"durationdatetime\", \"intervaldatetime\") xportr.numeric_metadata_types defaults c(\"integer\", \"numeric\", \"num\", \"float\") xportr.numeric_types defaults c(\"integer\", \"float\", \"numeric\", \"posixct\", \"posixt\", \"time\", \"date\")","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"options-with-xportr-options-","dir":"Reference","previous_headings":"","what":"Options with xportr_options()","title":"Get or set xportr options — xportr_options","text":"Alternative options(), xportr_options() function can used set options. xportr_options() function also returns current options character vector options keys passed . nothing passed , returns state xportr options.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get or set xportr options — xportr_options","text":"","code":"xportr_options(\"xportr.df_label\") #> $xportr.df_label #> [1] \"label\" #> xportr_options(xportr.df_label = \"data_label\", xportr.label = \"custom_label\") xportr_options(c(\"xportr.label\", \"xportr.df_label\")) #> $xportr.label #> [1] \"custom_label\" #> #> $xportr.df_label #> [1] \"data_label\" #> xportr_options() #> $xportr.df_domain_name #> [1] \"dataset\" #> #> $xportr.df_label #> [1] \"data_label\" #> #> $xportr.domain_name #> [1] \"dataset\" #> #> $xportr.variable_name #> [1] \"variable\" #> #> $xportr.type_name #> [1] \"type\" #> #> $xportr.label #> [1] \"custom_label\" #> #> $xportr.length #> [1] \"length\" #> #> $xportr.order_name #> [1] \"order\" #> #> $xportr.format_name #> [1] \"format\" #> #> $xportr.format_verbose #> [1] \"none\" #> #> $xportr.label_verbose #> [1] \"none\" #> #> $xportr.length_verbose #> [1] \"none\" #> #> $xportr.type_verbose #> [1] \"none\" #> #> $xportr.character_types #> [1] \"character\" #> #> $xportr.character_metadata_types #> [1] \"character\" \"char\" \"text\" #> [4] \"date\" \"posixct\" \"posixt\" #> [7] \"datetime\" \"time\" \"partialdate\" #> [10] \"partialtime\" \"partialdatetime\" \"incompletedatetime\" #> [13] \"durationdatetime\" \"intervaldatetime\" #> #> $xportr.numeric_metadata_types #> [1] \"integer\" \"numeric\" \"num\" \"float\" #> #> $xportr.numeric_types #> [1] \"integer\" \"float\" \"numeric\" \"posixct\" \"posixt\" \"time\" \"date\" #>"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options_list.html","id":null,"dir":"Reference","previous_headings":"","what":"A list with all the supported options of xportr — xportr_options_list","title":"A list with all the supported options of xportr — xportr_options_list","text":"internal list supported options xportr defaults","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A list with all the supported options of xportr — xportr_options_list","text":"","code":"xportr_options_list"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options_list.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A list with all the supported options of xportr — xportr_options_list","text":"object class list length 17.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":null,"dir":"Reference","previous_headings":"","what":"Order variables of a dataset according to Spec — xportr_order","title":"Order variables of a dataset according to Spec — xportr_order","text":"dplyr::arrange() function used order columns dataframe. variables missing order value appended end dataframe variables order.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Order variables of a dataset according to Spec — xportr_order","text":"","code":"xportr_order( .df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Order variables of a dataset according to Spec — xportr_order","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Order variables of a dataset according to Spec — xportr_order","text":"Dataframe re-ordered according spec","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"messaging","dir":"Reference","previous_headings":"","what":"Messaging","title":"Order variables of a dataset according to Spec — xportr_order","text":"var_ord_msg() primary messaging tool xportr_order(). two primary messages output var_ord_msg(). first \"moved\" variables. variables found metadata file moved end dataset. message generated noting number, , variables moved end dataset. variables moved, 'verbose' argument 'stop', 'warn', 'message', message generated detailing variables moved. second primary message number variables dataset, correct order. message generated noting number, , variables reordered. variables reordered, 'verbose' argument 'stop', 'warn', 'message', message generated detailing variables reordered.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Order variables of a dataset according to Spec — xportr_order","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments three columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata. Variable Order - passed 'xportr.order_name' option. Default: \"order\". values used arrange order variables. values order metadata numeric, coerced prevent alphabetical sorting numeric values.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Order variables of a dataset according to Spec — xportr_order","text":"","code":"adsl <- data.frame( BRTHDT = c(1, 1, 2), STUDYID = c(\"mid987650\", \"mid987650\", \"mid987650\"), TRT01A = c(\"Active\", \"Active\", \"Placebo\"), USUBJID = c(1001, 1002, 1003) ) metadata <- data.frame( dataset = c(\"adsl\", \"adsl\", \"adsl\", \"adsl\"), variable = c(\"STUDYID\", \"USUBJID\", \"TRT01A\", \"BRTHDT\"), order = 1:4 ) adsl <- xportr_order(adsl, metadata, domain = \"adsl\") #> ── All variables in specification file are in dataset ── #> #> ── 3 reordered in dataset ── #>"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":null,"dir":"Reference","previous_headings":"","what":"Split xpt file output — xportr_split","title":"Split xpt file output — xportr_split","text":"Per FDA Study Data Technical Conformance Guide(https://www.fda.gov/media/88173/download) section 3.3.2, dataset files sizes exceed 5 GB. datasets large enough, split based variable. example, laboratory readings ADLB can split LBCAT split hematology chemistry data.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split xpt file output — xportr_split","text":"","code":"xportr_split(.df, split_by = NULL)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split xpt file output — xportr_split","text":".df data frame CDISC standard. split_by quoted variable passed base::split().","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split xpt file output — xportr_split","text":"data frame additional attribute added xportr_write() knows split data frame.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Split xpt file output — xportr_split","text":"function tell xportr_write() split data frame based variable passed split_by. written, file name prepended number uniqueness. files noted Reviewer Guides per CDISC guidance note split files.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split xpt file output — xportr_split","text":"","code":"adlb <- data.frame( USUBJID = c(1001, 1002, 1003), LBCAT = c(\"HEMATOLOGY\", \"HEMATOLOGY\", \"CHEMISTRY\") ) adlb <- xportr_split(adlb, \"LBCAT\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce variable type — xportr_type","title":"Coerce variable type — xportr_type","text":"XPT v5 datasets data types character numeric. xportr_type attempts collapse R classes two XPT types. 'xportr.character_types' option used explicitly collapse class column character using .character. Similarly, 'xportr.numeric_types' collapse column numeric type. type passed variable, assumed numeric coerced .numeric().","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce variable type — xportr_type","text":"","code":"xportr_type( .df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce variable type — xportr_type","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coerce variable type — xportr_type","text":"Returns modified table.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Coerce variable type — xportr_type","text":"Certain care taken using timing variables. R serializes dates based reference date 01/01/1970 XPT uses 01/01/1960. can result dates 10 years outputting R XPT using date class. reason, xportr try determine happen variables appear used denote time.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"messaging","dir":"Reference","previous_headings":"","what":"Messaging","title":"Coerce variable type — xportr_type","text":"type_log() primary messaging tool xportr_type(). number column types mismatch reported type metadata, , reported xportr_type(). type mismatches, 'verbose' argument 'stop', 'warn', 'message', mismatch detailed actual type data type noted metadata.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Coerce variable type — xportr_type","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments four columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata. Variable Type - passed 'xportr.type_name'. Default: \"type\". used note XPT variable \"type\" options numeric character. (Option ) Character Types - list classes explicitly coerced XPT Character type. Default: c( \"character\", \"char\", \"text\", \"date\", \"posixct\", \"posixt\", \"datetime\", \"time\", \"partialdate\", \"partialtime\", \"partialdatetime\", \"incompletedatetime\", \"durationdatetime\", \"intervaldatetime\")` (Option ) Numeric Types - list classes explicitly coerced XPT numeric type. Default: c(\"integer\", \"numeric\", \"num\", \"float\")","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coerce variable type — xportr_type","text":"","code":"metadata <- data.frame( dataset = \"test\", variable = c(\"Subj\", \"Param\", \"Val\", \"NotUsed\"), type = c(\"numeric\", \"character\", \"numeric\", \"character\") ) .df <- data.frame( Subj = as.character(123, 456, 789), Different = c(\"a\", \"b\", \"c\"), Val = c(\"1\", \"2\", \"3\"), Param = c(\"param1\", \"param2\", \"param3\") ) df2 <- xportr_type(.df, metadata, \"test\") #> ── Variable type mismatches found. ── #> #> ✔ 2 variables coerced"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":null,"dir":"Reference","previous_headings":"","what":"Write xpt v5 transport file — xportr_write","title":"Write xpt v5 transport file — xportr_write","text":"Writes local data frame SAS transport file version 5. SAS transport format open format, required submission data FDA.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write xpt v5 transport file — xportr_write","text":"","code":"xportr_write( .df, path, metadata = NULL, domain = NULL, strict_checks = FALSE, label = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write xpt v5 transport file — xportr_write","text":".df data frame write. path Path transport file written. File name sans used xpt name. metadata data frame containing dataset. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. strict_checks TRUE, xpt validation report errors write dataset. FALSE, xpt validation report warnings continue writing dataset. Defaults FALSE label Previously used set Dataset label. Use metadata argument set dataset label.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write xpt v5 transport file — xportr_write","text":"data frame. xportr_write() returns input data invisibly.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Write xpt v5 transport file — xportr_write","text":"Variable dataset labels stored \"label\" attribute. SAS format stored \"SASformat\" attribute. SAS type based metadata attribute.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Write xpt v5 transport file — xportr_write","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments two columns must present: Domain Name - passed 'xportr.df_domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Label Name - passed 'xportr.df_label' option. Default: \"label\". Character values update 'label' attribute dataframe passed haven::write_xpt note label.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write xpt v5 transport file — xportr_write","text":"","code":"adsl <- data.frame( SUBL = as.character(123, 456, 789), DIFF = c(\"a\", \"b\", \"c\"), VAL = c(\"1\", \"2\", \"3\"), PARAM = c(\"param1\", \"param2\", \"param3\") ) var_spec <- data.frame( dataset = \"adsl\", label = \"Subject-Level Analysis Dataset\", data_label = \"ADSL\" ) xportr_write(adsl, path = paste0(tempdir(), \"/adsl.xpt\"), domain = \"adsl\", metadata = var_spec, strict_checks = FALSE )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xpt_validate.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate Dataset Can be Written to xpt — xpt_validate","title":"Validate Dataset Can be Written to xpt — xpt_validate","text":"Function used validate dataframes sent haven::write_xpt writing.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xpt_validate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate Dataset Can be Written to xpt — xpt_validate","text":"","code":"xpt_validate(data)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xpt_validate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate Dataset Can be Written to xpt — xpt_validate","text":"data Dataset exported xpt file","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xpt_validate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate Dataset Can be Written to xpt — xpt_validate","text":"Returns character vector failed conditions","code":""}] +[{"path":"https://atorus-research.github.io/xportr/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2021 Atorus/GSK JPT Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"motivation","dir":"Articles","previous_headings":"","what":"Motivation","title":"Standards in Different Regulatory Agencies","text":"xportr package designed help clinical programmers create CDISC compliant xpt files. provides functionality associate metadata information local R data frame, perform data set level validation checks, convert transport v5 file (xpt). However, technical requirements related xpt files can change across different regulatory agencies. vignette aims start provide clear concise summary differences agencies xpt files. updates come later package releases. following section delve various technical specifications per FDA, NMPA, PMDA guidelines.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt","dir":"Articles","previous_headings":"Motivation > File name - character","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"first character must English letter (, B, C, . . ., Z) underscore (_). Subsequent characters can letters, numeric digits (0, 1, . . ., 9), underscores. can use uppercase lowercase letters. Blanks appear SAS names. Special characters, except underscore, allowed.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda","dir":"Articles","previous_headings":"Motivation > File name - character","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"Dataset transport file named transport file. Variable names, well variable dataset labels include American Standard Code Information Interchange (ASCII) text codes . Dataset names contain lowercase letters, numbers, must start letter.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa","dir":"Articles","previous_headings":"Motivation > File name - character","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"file name dataset name must SDTM ADaM datasets. Japanese dataset alphanumeric dataset must identical structure, except data lengths Japanese items corresponding alphanumeric character sequence","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda","dir":"Articles","previous_headings":"Motivation > File name - character","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-1","dir":"Articles","previous_headings":"Motivation > File name - length","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"maximum length 8 bytes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-1","dir":"Articles","previous_headings":"Motivation > File name - length","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"8 characters","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-1","dir":"Articles","previous_headings":"Motivation > File name - length","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-1","dir":"Articles","previous_headings":"Motivation > File name - length","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-2","dir":"Articles","previous_headings":"Motivation > Variable name","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"name can contain letters Latin alphabet, numerals, underscores. name contain blanks special characters except underscore. name must begin letter Latin alphabet (–Z, –z) underscore.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-2","dir":"Articles","previous_headings":"Motivation > Variable name","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"Variable names, well variable dataset labels include American Standard Code Information Interchange (ASCII) text codes . Variable names contain uppercase letters, numbers, must start letter","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-2","dir":"Articles","previous_headings":"Motivation > Variable name","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"Japanese dataset alphanumeric dataset must identical structure, except data lengths Japanese items corresponding alphanumeric character sequence","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-2","dir":"Articles","previous_headings":"Motivation > Variable name","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-3","dir":"Articles","previous_headings":"Motivation > Variable length","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"8 bytes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-3","dir":"Articles","previous_headings":"Motivation > Variable length","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"8 characters","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-3","dir":"Articles","previous_headings":"Motivation > Variable length","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-3","dir":"Articles","previous_headings":"Motivation > Variable length","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-4","dir":"Articles","previous_headings":"Motivation > Label character","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-4","dir":"Articles","previous_headings":"Motivation > Label character","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"Variable names, well variable dataset labels include American Standard Code Information Interchange (ASCII) text codes . submit study data following special characters variable dataset labels: 1. Unbalanced apostrophe, e.g., “Parkinson’s” 2. Unbalanced single double quotation marks 3. Unbalanced parentheses, braces brackets, e.g.,(, {[","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-4","dir":"Articles","previous_headings":"Motivation > Label character","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"Japanese dataset alphanumeric dataset must identical structure, except data lengths Japanese items corresponding alphanumeric character sequence","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-4","dir":"Articles","previous_headings":"Motivation > Label character","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"eSubmission China, one requirements translate foreign language data package (e.g., English) Chinese. Variable labels, dataset labels, MedDRA, Drug terms, primary endpoint-related code lists, etc., need translated English Chinese.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-5","dir":"Articles","previous_headings":"Motivation > Label length","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"40 bytes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-5","dir":"Articles","previous_headings":"Motivation > Label length","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"40 characters","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-5","dir":"Articles","previous_headings":"Motivation > Label length","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-5","dir":"Articles","previous_headings":"Motivation > Label length","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-6","dir":"Articles","previous_headings":"Motivation > Values character","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-6","dir":"Articles","previous_headings":"Motivation > Values character","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"Variable values broadly compatible software operating systems restricted ASCII text codes (printable values 128). Use UTF-8 extending character sets; however, use extended mappings recommended. Transcoding errors, variable length errors, lack software support multi byte UTF-8 encodings can result incorrect character display variable value truncation.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-6","dir":"Articles","previous_headings":"Motivation > Values character","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"variables collected Japanese risk losing certain information translating English, descriptions Japanese necessary appropriate, data written Japanese (hereinafter referred Japanese data) may submitted. Japanese dataset, Japanese items Japanese rest alphanumeric(=ASCII) data, similar alphanumeric dataset.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-6","dir":"Articles","previous_headings":"Motivation > Values character","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"eSubmission China, one requirements translate foreign language data package (e.g., English) Chinese. Variable labels, dataset labels, MedDRA, Drug terms, primary endpoint-related code lists, etc., need translated English Chinese.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-7","dir":"Articles","previous_headings":"Motivation > Values length","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"200 bytes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-7","dir":"Articles","previous_headings":"Motivation > Values length","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"allotted length column containing character (text) data set maximum length variable used across datasets study except supplementary qualification datasets.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-7","dir":"Articles","previous_headings":"Motivation > Values length","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-7","dir":"Articles","previous_headings":"Motivation > Values length","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-8","dir":"Articles","previous_headings":"Motivation > Format","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"SAS format","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-8","dir":"Articles","previous_headings":"Motivation > Format","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"SAS format","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-8","dir":"Articles","previous_headings":"Motivation > Format","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-8","dir":"Articles","previous_headings":"Motivation > Format","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-9","dir":"Articles","previous_headings":"Motivation > Type","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"Numeric character","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-9","dir":"Articles","previous_headings":"Motivation > Type","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-9","dir":"Articles","previous_headings":"Motivation > Type","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-9","dir":"Articles","previous_headings":"Motivation > Type","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"xpt-10","dir":"Articles","previous_headings":"Motivation > File size","what":"XPT","title":"Standards in Different Regulatory Agencies","text":"-","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"fda-10","dir":"Articles","previous_headings":"Motivation > File size","what":"FDA","title":"Standards in Different Regulatory Agencies","text":"5 GB","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"nmpa-10","dir":"Articles","previous_headings":"Motivation > File size","what":"NMPA","title":"Standards in Different Regulatory Agencies","text":"consulted sponsors datasets >= 5 GB requirement split datasets","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/agency_standards.html","id":"pmda-10","dir":"Articles","previous_headings":"Motivation > File size","what":"PMDA","title":"Standards in Different Regulatory Agencies","text":"Information yet collected.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Deep Dive into xportr","text":"vignette explore detail possibilities xportr package applying information metadata object R created dataset using core xportr functions. also explore following: goes Submission Health Authority, role xportr play Submission? xportr validating behind scenes? Breakdown xportr ADaM dataset specification file. Using options() xportr_metadata() enhance xportr experience. Understanding warning error messages xportr function. brief discussion future work. NOTE: use phrase metadata object throughout package. metadata object can either specification file read R dataframe metacore object. metadata object created via metacore package additional features covered , core using specification file. However, xportr work either dataframe metacore object.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"what-goes-in-a-submission-to-a-health-authority","dir":"Articles","previous_headings":"","what":"What goes in a Submission to a Health Authority?","title":"Deep Dive into xportr","text":"Quite bit! focus data deliverables supporting documentation needed successful submission Health Authority xportr can play key role. briefly look three parts: Study Data Standardization Plan SDTM Data Package ADaM Data Package","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"study-data-standardization-plan","dir":"Articles","previous_headings":"What goes in a Submission to a Health Authority?","what":"Study Data Standardization Plan","title":"Deep Dive into xportr","text":"Study Data Standardization Plan (SDSP) establishes documents plan describing data standardization approach clinical nonclinical studies within development program. SDSP also assists FDA identifying potential data standardization issues early development program. hope brevity section belie huge importance document. Please see Study Data Standardisation Plan (SDSP) Package maintained PHUSE working group. However, want focus actual data xportr can play role submission.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"sdtm-and-adam-data-packages","dir":"Articles","previous_headings":"What goes in a Submission to a Health Authority?","what":"SDTM and ADaM Data Packages","title":"Deep Dive into xportr","text":"SDTM: primary pieces SDTM package SDTM annotated case report forms (acrf.pdf), data definitions document (define.xml), Study Data Reviewer’s Guide (sdrg.pdf) datasets xpt Version 5 format. Version 5 xpt file required submission format datasets going Health Authorities. ADaM: key components ADaM package similar SDTM package additions: define.xml, Analysis Study Data Reviewer’s Guide (adrg.pdf), Analysis Results Metadata (analysis-results-metadata.pdf) datasets Version 5 xpt format. Data Packages need compliant xpt files, feel xportr can play pivotal role . core functions xportr can used apply information metadata object datasets giving users feedback quality metadata data. xportr_write() can used write final dataset xpt file, can submitted Health Authority.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"what-is-xportr-validating-in-these-data-packages","dir":"Articles","previous_headings":"What goes in a Submission to a Health Authority?","what":"What is {xportr} validating in these Data Packages?","title":"Deep Dive into xportr","text":"xpt Version 5 files form backbone successful Submission govern quite lot rules suggested guidelines. preparing data packages submission suite core xportr functions, plus xportr_write(), helps check datasets submission compliant. package checks many latest rules laid Study Data Technical Conformance Guide, please note yet exhaustive list checks. envision users also submitting xpts metadata additional validation software. core xportr functions applying labels, types, formats, order lengths provides feedback users submission compliance. However, final check implemented xportr_write() called create xpt. xportr_write() calls xpt_validate(), behind scenes/non-exported function final check compliance. time {xportr} v0.3.0 checking following user writes xpt file.:","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr-in-action","dir":"Articles","previous_headings":"","what":"{xportr} in action","title":"Deep Dive into xportr","text":"section, going explore 5 core xportr functions using: data(\"adsl_xportr\", package = \"xportr\") - ADSL ADaM dataset Pilot 3 Submission FDA data(\"var_spec\", package = \"xportr\") - ADSL ADaM Specification File Pilot 3 Submission FDA focus warning error messaging contrived examples functions manipulating either datasets specification files. NOTE: made ADSL Spec available package. Users can find additional datasets specification files repo example_data_specs folder. keep package minimum size.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"using-options-and-xportr_metadata-to-enhance-your-experience-","dir":"Articles","previous_headings":"{xportr} in action","what":"Using options() and xportr_metadata() to enhance your experience.","title":"Deep Dive into xportr","text":"dive functions, want point quality life utilities make xpt generation life little bit easier. options() xportr_options() xportr_metadata() NOTE: long well-defined metadata object need use options() xportr_metadata(), find handy use think deserve quick mention!","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"youve-got-options-or-xportr_options","dir":"Articles","previous_headings":"{xportr} in action","what":"You’ve got options() or xportr_options()","title":"Deep Dive into xportr","text":"xportr built certain assumptions around specification column names information columns. found company specification file can differ slightly assumptions. example, one company might call column Variables, another Variable another variables. Rather trying regex situation, introduced options(). options() allows users control assumptions inside xportr functions based needs. Additionally, helper function xportr_options() works just like options() , can also used get current state xportr options. Let’s take look example specification file names available package. can see columns start upper case letter spaces several . convert column names lower case deal spacing using dplyr functions base R, just use options()! using options() xportr_options() beginning script can tell xportr valid names (see chunk ). Please note set options package assumed every thing lowercase spaces names. running options() xportr_options(), xportr sees column Variable valid name rather variable. can inspect xportr_options function docs look additional options.","code":"library(xportr) library(dplyr) library(haven) data(\"adsl_xportr\", \"var_spec\", \"dataset_spec\", package = \"xportr\") colnames(var_spec) [1] \"Order\" \"Dataset\" \"Variable\" [4] \"Label\" \"Data Type\" \"Length\" [7] \"Significant Digits\" \"Format\" \"Mandatory\" [10] \"Assigned Value\" \"Codelist\" \"Common\" [13] \"Origin\" \"Pages\" \"Method\" [16] \"Predecessor\" \"Role\" \"Comment\" [19] \"Developer Notes\" ADSL <- adsl_xportr xportr_options( xportr.variable_name = \"Variable\", xportr.label = \"Label\", xportr.type_name = \"Data Type\", xportr.format = \"Format\", xportr.length = \"Length\", xportr.order_name = \"Order\" ) # Or alternatively options( xportr.variable_name = \"Variable\", xportr.label = \"Label\", xportr.type_name = \"Data Type\", xportr.format = \"Format\", xportr.length = \"Length\", xportr.order_name = \"Order\" )"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"are-we-being-too-verbose","dir":"Articles","previous_headings":"{xportr} in action","what":"Are we being too verbose?","title":"Deep Dive into xportr","text":"One final note options. 4 core xportr functions ability set messaging \"none\", \"message\", \"warn\", \"stop\". Setting calls can bit repetitive. can use options() xportr_options() set higher level avoid repetition.","code":"# Default verbose is set to `none` xportr_options( xportr.format_verbose = \"none\", xportr.label_verbose = \"none\", xportr.length_verbose = \"none\", xportr.type_verbose = \"none\" ) xportr_options( xportr.format_verbose = \"none\", # Disables any messaging, keeping the console output clean xportr.label_verbose = \"message\", # Sends a standard message to the console xportr.length_verbose = \"warn\", # Sends a warning message to the console xportr.type_verbose = \"stop\" # Stops execution and sends an error message to the console )"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"going-meta","dir":"Articles","previous_headings":"{xportr} in action","what":"Going meta","title":"Deep Dive into xportr","text":"core xportr functions requires several inputs: valid dataframe, metadata object domain name, along optional messaging. example, simple call using functions. can see, lot information repeated call. help reduce repetitive calls, created xportr_metadata(). user can just set metadata object Domain name first call, passed functions. Much cleaner!","code":"ADSL %>% xportr_type(var_spec, \"ADSL\", \"message\") %>% xportr_length(var_spec, \"ADSL\", verbose = \"message\") %>% xportr_label(var_spec, \"ADSL\", \"message\") %>% xportr_order(var_spec, \"ADSL\", \"message\") %>% xportr_format(var_spec, \"ADSL\") %>% xportr_df_label(dataset_spec, \"ADSL\") %>% xportr_write(\"adsl.xpt\") ADSL %>% xportr_metadata(var_spec, \"ADSL\") %>% xportr_type() %>% xportr_length(length_source = \"metadata\") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(\"adsl.xpt\")"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"warnings-and-errors","dir":"Articles","previous_headings":"{xportr} in action","what":"Warnings and Errors","title":"Deep Dive into xportr","text":"next six sections, going explore Warnings Errors messages generated xportr core functions. better explore , either manipulate ADaM dataset specification file help showcase ability xportr functions detect issues. NOTE: made ADSL, xportr::adsl, Specification File, xportr::var_spec, available package. Users can find additional datasets specification files repo example_data_specs folder.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"setting-up-our-metadata-object","dir":"Articles","previous_headings":"{xportr} in action > Warnings and Errors","what":"Setting up our metadata object","title":"Deep Dive into xportr","text":"First, let’s read specification file call var_spec. Note using options() . slight manipulation column names lower case, changing Data Type type making Order column numeric. can also use options() step well. var_spec object five dataset specification files stacked top . make use ADSL subset var_spec. can make use Search field dataset column subset specification file ADSL Similarly, can read Dataset spec file call dataset_spec.","code":"var_spec <- var_spec %>% rename(type = \"Data Type\") %>% rename_with(tolower) dataset_spec <- dataset_spec %>% rename(label = \"Description\") %>% rename_with(tolower)"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_type","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_type()","title":"Deep Dive into xportr","text":"going explore type column metadata object. submission Health Authority character numeric types data. ADSL data several columns Date type: TRTSDT, TRTEDT, SCRFDT, EOSDT, FRVDT, RANDDT, DTHDT, LSTALVDT - hood actually numeric values left . change one variable type factor variable, common data structure R, give us educational opportunities see xportr_type() action. Success! can see , xportr_type() applied types metadata object STUDYID variables converting proper type. functions xportr also display coercion user console, seen . Note xportr_type(verbose = \"warn\") set function provided feedback, show console, variables converted warning message. However, can set verbose = \"stop\" types applied data match specification file. Using verbose = \"stop\" instantly stop processing function create object. user need alter variables R script using xportr_type()","code":"adsl_fct <- ADSL %>% mutate(STUDYID = as_factor(STUDYID)) Rows: 306 Columns: 9 $ STUDYID CDISCPILOT01, CDISCPILOT01, CDISCPILOT01, CDISCPILOT01, CDISC… $ TRTSDT 2014-01-02, 2012-08-05, 2013-07-19, 2014-03-18, 2014-07-01, … $ TRTEDT 2014-07-02, 2012-09-01, 2014-01-14, 2014-03-31, 2014-12-30, … $ SCRFDT NA, NA, NA, NA, NA, NA, 2013-12-20, NA, NA, NA, NA, NA, NA, … $ EOSDT 2014-07-02, 2012-09-02, 2014-01-14, 2014-04-14, 2014-12-30, … $ FRVDT NA, 2013-02-18, NA, 2014-09-15, NA, 2013-07-28, NA, NA, 2013… $ RANDDT 2014-01-02, 2012-08-05, 2013-07-19, 2014-03-18, 2014-07-01, … $ DTHDT NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, … $ LSTALVDT 2014-07-02, 2012-09-02, 2014-01-14, 2014-04-14, 2014-12-30, … adsl_type <- xportr_type(.df = adsl_fct, metadata = var_spec, domain = \"ADSL\", verbose = \"warn\") ── Variable type mismatches found. ── ✔ 1 variables coerced Warning: Variable type(s) in dataframe don't match metadata: `STUDYID` glimpse(adsl_type_glimpse) Rows: 306 Columns: 9 $ STUDYID \"CDISCPILOT01\", \"CDISCPILOT01\", \"CDISCPILOT01\", \"CDISCPILOT01… $ TRTSDT 2014-01-02, 2012-08-05, 2013-07-19, 2014-03-18, 2014-07-01, … $ TRTEDT 2014-07-02, 2012-09-01, 2014-01-14, 2014-03-31, 2014-12-30, … $ SCRFDT NA, NA, NA, NA, NA, NA, 2013-12-20, NA, NA, NA, NA, NA, NA, … $ EOSDT 2014-07-02, 2012-09-02, 2014-01-14, 2014-04-14, 2014-12-30, … $ FRVDT NA, 2013-02-18, NA, 2014-09-15, NA, 2013-07-28, NA, NA, 2013… $ RANDDT 2014-01-02, 2012-08-05, 2013-07-19, 2014-03-18, 2014-07-01, … $ DTHDT NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, … $ LSTALVDT 2014-07-02, 2012-09-02, 2014-01-14, 2014-04-14, 2014-12-30, … adsl_type <- xportr_type(.df = adsl_fct, metadata = var_spec, domain = \"ADSL\", verbose = \"stop\") ── Variable type mismatches found. ── ✔ 1 variables coerced Error in `xportr_logger()` at xportr/R/messages.R:98:5: ! Variable type(s) in dataframe don't match metadata: `STUDYID`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_length","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_length()","title":"Deep Dive into xportr","text":"two sources length (data-driven spec-driven): Data-driven length: max length character columns 8 data types Spec-driven length: metadata Users can either specify length metadata leave blank data-driven length. length missing metadata, data-driven length applied. Next use xportr_length() apply length column metadata object ADSL dataset. Using str() function displayed variables attributes. can see variable label, information lengths variable. Using xportr_length() verbose = \"warn\" can apply length column columns dataset. function detects two variables, TRTDUR DCREASCD missing metadata file. Note variables slight misspellings dataset metadata, great catch! However, lengths still applied TRTDUR give length 8 DCREASCD length 200. Using str() function, can see xportr_length() successfully applied lengths variable variables dataset. Just like xportr_type(), setting verbose = \"stop\" immediately stops R processing lengths. function detects missing variables apply lengths dataset corrective action applied.","code":"tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_length <- xportr_length( .df = ADSL, metadata = var_spec, domain = \"ADSL\", verbose = \"warn\", length_source = \"metadata\" ) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` Warning: Variable(s) present in dataframe but doesn't exist in `metadata`.Problem with `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" ..- attr(*, \"width\")= num 12 $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" ..- attr(*, \"width\")= num 11 $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" ..- attr(*, \"width\")= num 4 $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" ..- attr(*, \"width\")= num 20 $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" ..- attr(*, \"width\")= num 20 $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" ..- attr(*, \"width\")= num 10 $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" ..- attr(*, \"width\")= num 10 $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" ..- attr(*, \"width\")= num 0 $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" ..- attr(*, \"width\")= num 16 $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" ..- attr(*, \"width\")= num 10 $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" ..- attr(*, \"width\")= num 1 $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" ..- attr(*, \"width\")= num 3 $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" ..- attr(*, \"width\")= num 8 $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" ..- attr(*, \"width\")= num 5 $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" ..- attr(*, \"width\")= num 1 $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" ..- attr(*, \"width\")= num 32 $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" ..- attr(*, \"width\")= num 22 $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" ..- attr(*, \"width\")= num 8 $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"width\")= num 20 $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" ..- attr(*, \"width\")= num 8 $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"width\")= num 20 $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" ..- attr(*, \"width\")= num 3 $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" ..- attr(*, \"width\")= num 10 $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" ..- attr(*, \"width\")= num 8 $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"width\")= num 20 $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"width\")= num 20 $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"width\")= num 1 $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"width\")= num 1 $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"width\")= num 8 $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"width\")= num 12 $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 0 $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"width\")= num 8 $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"width\")= num 8 $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"width\")= num 1 $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"width\")= num 9 $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"width\")= num 5 $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"width\")= num 2 $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 5 $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 1 $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 0 $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 1 - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\" adsl_length <- xportr_length( .df = ADSL, metadata = var_spec, domain = \"ADSL\", verbose = \"stop\", length_source = \"metadata\" ) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` Error in `xportr_logger()` at xportr/R/messages.R:119:5: ! Variable(s) present in dataframe but doesn't exist in `metadata`.Problem with `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_label","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_label()","title":"Deep Dive into xportr","text":"creating dataset R often find R removes label variable. Using xportr_label() can easily re-apply labels variables one quick action. example, going manipulate metadata ADSL dataset: metadata variable TRTSDT label greater 40 characters. ADSL dataset labels stripped . Remember length example, labels original dataset seen str() output. successfully removed labels. Using xportr_label() apply labels metadata dataset. Please note using verbose = \"warn\" two issues TRTDUR DCREASCD reported missing metadata file. additional message sent around TRTSDT label length greater 40. Success! labels applied present metadata dataset. However, please note TRTSDT variable label characters greater 40 applied dataset TRTDUR DCREASCD empty variable labels. Just like functions, setting verbose = \"stop\" immediately stops R processing labels. function detects mismatches variables labels well label greater 40 characters. stops process, none labels applied dataset corrective action applied.","code":"var_spec_lbl <- var_spec %>% mutate(label = if_else(variable == \"TRTSDT\", \"Length of variable label must be 40 characters or less\", label )) adsl_lbl <- ADSL adsl_lbl <- haven::zap_label(ADSL) tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... $ RFICDTC : chr [1:306] NA NA NA NA ... $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... $ DTHDTC : chr [1:306] NA NA NA NA ... $ DTHFL : chr [1:306] NA NA NA NA ... $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_lbl <- xportr_label(.df = adsl_lbl, metadata = var_spec_lbl, domain = \"ADSL\", verbose = \"warn\") ── Variable labels missing from metadata. ── ✔ 30 labels skipped Warning: Variable(s) present in dataframe but doesn't exist in `metadata`. ✖ Problem with `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` Warning: Length of variable label must be 40 characters or less. ✖ Problem with `TRTSDT`. tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Died?\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Planned Treatment for Period 01\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Actual Treatment for Period 01\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"label\")= chr \"\" $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"label\")= chr \"\" $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"label\")= chr \"Total Treatment Duration (Days)\" $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"label\")= chr \"End of Study Status\" $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"label\")= chr \"Safety Population Flag\" $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"label\")= chr \"\" $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"label\")= chr \"Pooled Age Group 1\" $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"label\")= chr \"\" $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"\" - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\" adsl_label <- xportr_label(.df = adsl_lbl, metadata = var_spec_lbl, domain = \"ADSL\", verbose = \"stop\") ── Variable labels missing from metadata. ── ✔ 30 labels skipped Error in `xportr_logger()` at xportr/R/messages.R:144:5: ! Variable(s) present in dataframe but doesn't exist in `metadata`. ✖ Problem with `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_order","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_order()","title":"Deep Dive into xportr","text":"order dataset can greatly increase readability dataset downstream stakeholders. example, treatment related variables analysis variables grouped together can help inspection understanding dataset. xportr_order() can take order information metadata apply dataset. Readers encouraged inspect dataset metadata see past order updated order calling function. Note messaging xportr_order(): Variables metadata moved end Variables order re-ordered message printed ones re-ordered. Just like functions, setting verbose = \"stop\" immediately stops R processing order. variables metadata missing either, re-ordering process corrective action performed.","code":"adsl_ord <- xportr_order(.df = ADSL, metadata = var_spec, domain = \"ADSL\", verbose = \"warn\") ── 30 variables not in spec and moved to end ── Warning: Variable moved to end in `.df`: `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` ── 42 reordered in dataset ── Warning: Variable reordered in `.df`: `SITEID`, `ARM`, `TRT01P`, `TRT01A`, `TRTSDT`, `TRTEDT`, `TRTDURD`, `AGE`, `AGEGR1`, `AGEU`, `RACE`, `ETHNIC`, `SAFFL`, `DTHFL`, `RFSTDTC`, `RFENDTC`, `EOSSTT`, `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, and `RACEGR1` adsl_ord <- xportr_order(.df = ADSL, metadata = var_spec, domain = \"ADSL\", verbose = \"stop\") ── 30 variables not in spec and moved to end ── Error in `xportr_logger()` at xportr/R/messages.R:171:5: ! Variable moved to end in `.df`: `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_format","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_format()","title":"Deep Dive into xportr","text":"Formats play important role SAS language column specification files. able easily apply formats xpt file allow downstream users SAS quickly format data appropriately reading SAS-based system. xportr_format() can take formats apply . Please reference xportr_length() xportr_label() note missing attr() formats ADSL dataset. example slightly different previous examples. need use xportr_type() coerce R Date variables others types character numeric. can use xportr_format() apply format column dataset. Success! taken metadata formats applied dataset. Please inspect variables like TRTSDT DISONSDT see DATE9. format applied. time {xportr} v0.3.0 implemented warnings error messaging function. However, xportr_write() xpt_validate() check formats applied valid SAS formats.","code":"adsl_fmt <- ADSL %>% xportr_type(metadata = var_spec, domain = \"ADSL\", verbose = \"warn\") %>% xportr_format(metadata = var_spec, domain = \"ADSL\") tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" ..- attr(*, \"format.sas\")= chr \"\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" ..- attr(*, \"format.sas\")= chr \"\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" ..- attr(*, \"format.sas\")= chr \"\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" ..- attr(*, \"format.sas\")= chr \"\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" ..- attr(*, \"format.sas\")= chr \"\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" ..- attr(*, \"format.sas\")= chr \"\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" ..- attr(*, \"format.sas\")= chr \"\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" ..- attr(*, \"format.sas\")= chr \"\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" ..- attr(*, \"format.sas\")= chr \"\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" ..- attr(*, \"format.sas\")= chr \"\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" ..- attr(*, \"format.sas\")= chr \"\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" ..- attr(*, \"format.sas\")= chr \"\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" ..- attr(*, \"format.sas\")= chr \"\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" ..- attr(*, \"format.sas\")= chr \"\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" ..- attr(*, \"format.sas\")= chr \"\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" ..- attr(*, \"format.sas\")= chr \"\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" ..- attr(*, \"format.sas\")= chr \"\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" ..- attr(*, \"format.sas\")= chr \"\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"format.sas\")= chr \"\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" ..- attr(*, \"format.sas\")= chr \"\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"format.sas\")= chr \"\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" ..- attr(*, \"format.sas\")= chr \"\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" ..- attr(*, \"format.sas\")= chr \"\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" ..- attr(*, \"format.sas\")= chr \"\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"format.sas\")= chr \"\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"format.sas\")= chr \"\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"format.sas\")= chr \"\" $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" \"2012-09-01 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"format.sas\")= chr \"\" $ TRTSDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" \"2012-09-01\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"format.sas\")= chr \"\" $ SCRFDT : Date[1:306], format: NA NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"format.sas\")= chr \"\" $ FRVDT : Date[1:306], format: NA \"2013-02-18\" ... $ RANDDT : Date[1:306], format: \"2014-01-02\" \"2012-08-05\" ... $ DTHDT : Date[1:306], format: NA NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ LSTALVDT: Date[1:306], format: \"2014-07-02\" \"2012-09-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"format.sas\")= chr \"\" $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"format.sas\")= chr \"\" $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"format.sas\")= chr \"\" $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"format.sas\")= chr \"\" $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"format.sas\")= chr \"\" - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\""},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr_write","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr_write()","title":"Deep Dive into xportr","text":"Finally, want write xpt dataset metadata applied. make use xportr_metadata() reduce repetitive metadata domain specifications. use default option verbose, just message set anything verbose. xportr_write() specify path, just current working directory, set dataset label toggle strict_checks FALSE. also note worthy can set dataset label using xportr_df_label dataset_spec used xportr_write() Success! applied types, lengths, labels, ordering formats dataset. Note messages written console. Remember TRTDUR DCREASCD present metadata, dataset. impacts messaging lengths labels xportr printing feedback us two issues. 5 types coerced, well 36 variables re-ordered. Note strict_checks set FALSE. next two examples showcase strict_checks = TRUE option xportr_write() look formats labels. several ---DT type variables, xportr_write() detects lack formats applied. correct remember can use xportr_type() xportr_format() apply formats xpt dataset. manipulated labels greater 40 characters TRTSDT. turned xportr_label() verbose options produce message. However, xportr_write() strict_checks = TRUE error one many xpt_validate() checks going behind scenes.","code":"ADSL %>% xportr_metadata(var_spec, \"ADSL\") %>% xportr_type() %>% xportr_length(length_source = \"metadata\") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = \"adsl.xpt\", strict_checks = FALSE) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` ── Variable labels missing from metadata. ── ✔ 30 labels skipped ── 30 variables not in spec and moved to end ── ── 42 reordered in dataset ── ADSL %>% xportr_write(path = \"adsl.xpt\", metadata = dataset_spec, domain = \"ADSL\", strict_checks = TRUE) var_spec_lbl <- var_spec %>% mutate(label = if_else(variable == \"TRTSDT\", \"Length of variable label must be 40 characters or less\", label )) ADSL %>% xportr_metadata(var_spec_lbl, \"ADSL\") %>% xportr_label() %>% xportr_type() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = \"adsl.xpt\", strict_checks = TRUE) ── Variable labels missing from metadata. ── ✔ 30 labels skipped Warning: Length of variable label must be 40 characters or less. ✖ Problem with `TRTSDT`. Error in `xportr_write()`: ! The following validation checks failed: • Label 'TRTSDT=Length of variable label must be 40 characters or less' must be 40 characters or less."},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"xportr","dir":"Articles","previous_headings":"{xportr} in action","what":"xportr()","title":"Deep Dive into xportr","text":"many functions call? Simplify xportr(). bundles core xportr functions writing xpt. xportr() equivalent calling following functions individually:","code":"xportr( ADSL, var_metadata = var_spec, df_metadata = dataset_spec, domain = \"ADSL\", verbose = \"none\", path = \"adsl.xpt\" ) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` ── Variable labels missing from metadata. ── ✔ 30 labels skipped ── 30 variables not in spec and moved to end ── ── 42 reordered in dataset ── ADSL %>% xportr_metadata(var_spec, \"ADSL\") %>% xportr_type() %>% xportr_length(length_source = \"metadata\") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = \"adsl.xpt\", strict_checks = FALSE) ── Variable lengths missing from metadata. ── ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` ── Variable labels missing from metadata. ── ✔ 30 labels skipped ── 30 variables not in spec and moved to end ── ── 42 reordered in dataset ──"},{"path":"https://atorus-research.github.io/xportr/dev/articles/deepdive.html","id":"future-work","dir":"Articles","previous_headings":"{xportr} in action","what":"Future Work","title":"Deep Dive into xportr","text":"xportr still undergoing development. hope produce vignettes functions allow users bulk process multiple datasets well examples piping xpt files related documentation validation software service. always, please let us know feature requests, documentation updates bugs GitHub repo.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"getting-started-with-xportr","dir":"Articles","previous_headings":"","what":"Getting Started with xportr","title":"Getting Started","text":"demo make use small ADSL dataset available xportr package following features: 306 observations 51 variables Data types character numeric Missing labels variables Missing label data set Order variables following specification file Formats missing create fully compliant v5 xpt ADSL dataset, developed using R, need apply 6 main functions within xportr package: xportr_type() xportr_length() xportr_order() xportr_format() xportr_label() xportr_write()","code":"# Loading packages library(dplyr) library(labelled) library(xportr) library(readxl) # Loading in our example data data(\"adsl_xportr\", package = \"xportr\")"},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"preparing-your-specification-files","dir":"Articles","previous_headings":"","what":"Preparing your Specification Files","title":"Getting Started","text":"order make use functions within xportr need create R data frame contains specification file. likely need pre-processing spec sheets loading spec files work appropriately xportr functions. Please see example spec sheets system.file(file.path(\"specs\", \"ADaM_spec.xlsx\"), package = \"xportr\") see xportr expects specification sheets. quick snapshot specification file pertaining ADSL data set, make use 6 xportr function calls . Take note order, label, type, length format columns.","code":"var_spec <- read_xlsx( system.file(file.path(\"specs/\", \"ADaM_spec.xlsx\"), package = \"xportr\"), sheet = \"Variables\" ) %>% rename(type = \"Data Type\") %>% rename_with(tolower)"},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_type","dir":"Articles","previous_headings":"","what":"xportr_type()","title":"Getting Started","text":"NOTE: make use str() expose attributes (length, labels, formats, type) datasets. suppressed calls sake brevity. order compliant transport v5 specifications xpt file can two data types: character numeric/dbl. Currently ADSL data set chr, dbl, time, factor date. Using xportr_type() supplied specification file, can coerce variables ADSL set either numeric character. Now appropriate types applied dataset seen .","code":"tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_type <- xportr_type(adsl_xportr, var_spec, domain = \"ADSL\", verbose = \"message\") tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\""},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_length","dir":"Articles","previous_headings":"","what":"xportr_length()","title":"Getting Started","text":"Next can apply lengths variable level specification file data frame. xportr_length() identify variables missing specification file. function also alert many lengths applied successfully. apply lengths lets verify lengths applied original dataframe. lengths applied variables seen printout - lengths attr() part variables. Let’s now use xportr_length() apply lengths specification file. Note additional attr(*, \"width\")= variable width. directly applied specification file loaded !","code":"tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_length <- adsl_xportr %>% xportr_length(var_spec, domain = \"ADSL\", verbose = \"message\") tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" ..- attr(*, \"width\")= num 21 $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" ..- attr(*, \"width\")= num 30 $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" ..- attr(*, \"width\")= num 8 $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" ..- attr(*, \"width\")= num 19 $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" ..- attr(*, \"width\")= num 19 $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" ..- attr(*, \"width\")= num 19 $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" ..- attr(*, \"width\")= num 19 $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" ..- attr(*, \"width\")= num 19 $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" ..- attr(*, \"width\")= num 19 $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Death\" ..- attr(*, \"width\")= num 19 $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" ..- attr(*, \"width\")= num 2 $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" ..- attr(*, \"width\")= num 5 $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" ..- attr(*, \"width\")= num 8 $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" ..- attr(*, \"width\")= num 10 $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" ..- attr(*, \"width\")= num 1 $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" ..- attr(*, \"width\")= num 60 $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" ..- attr(*, \"width\")= num 100 $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" ..- attr(*, \"width\")= num 20 $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"width\")= num 200 $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" ..- attr(*, \"width\")= num 20 $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"width\")= num 200 $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" ..- attr(*, \"width\")= num 3 $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" ..- attr(*, \"width\")= num 19 $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" ..- attr(*, \"width\")= num 8 $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" ..- attr(*, \"width\")= num 40 $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" ..- attr(*, \"width\")= num 40 $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"width\")= num 2 $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"width\")= num 2 $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"width\")= num 8 $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"width\")= num 200 $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 2 $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"width\")= num 8 $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"width\")= num 8 $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"width\")= num 2 $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"width\")= num 200 $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"width\")= num 20 $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"width\")= num 80 $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 200 $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 200 $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 200 $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"width\")= num 200 - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\""},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_order","dir":"Articles","previous_headings":"","what":"xportr_order()","title":"Getting Started","text":"Please note order ADSL variables, see , match specification file order column. can quickly remedy call xportr_order(). Note variable SITEID moved well many others match specification file order column. Variables spec moved end data message written console.","code":"adsl_order <- xportr_order(adsl_xportr, var_spec, domain = \"ADSL\", verbose = \"message\") ── All variables in specification file are in dataset ── ── 50 reordered in dataset ── Variable reordered in `.df`: `SITEID`, `USUBJID`, `SUBJID`, `COUNTRY`, `AGE`, `AGEU`, `AGEGR1`, `SEX`, `RACE`, `RACEGR1`, `ETHNIC`, `RFSTDTC`, `RFENDTC`, `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DMDTC`, `DMDY`, `SAFFL`, `ARM`, `ARMCD`, `ACTARM`, `ACTARMCD`, `TRT01P`, `TRT01A`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `TRTSDT`, `TRTEDT`, `DTHFL`, `DTHDTC`, `DTHDT`, `DTHDTF`, `DTHADY`, `REGION1`, `TRTDURD`, `LDDTHELD`, `LSTALVDT`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, `DTHB30FL`, `FRVDT`, `RANDDT`, `SCRFDT`, `EOSDT`, and `EOSSTT`"},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_format","dir":"Articles","previous_headings":"","what":"xportr_format()","title":"Getting Started","text":"Now apply formats dataset. typically DATE9., DATETIME20 TIME5, many others can used. Notice ADSL dataset 8 Date/Time variables missing formats. just take peak TRT variables, NULL format. Using xportr_format() can apply formats dataset. NOTE: can use attr(data$variable, = \"format\") inspect formats applied dataframe. output individual calls bound together easier viewing.","code":"# A tibble: 4 × 2 Variable Format 1 TRTSDT 2 TRTEDT 3 TRTSDTM 4 TRTEDTM adsl_fmt <- adsl_xportr %>% xportr_format(var_spec, domain = \"ADSL\") # A tibble: 4 × 2 Variable Format 1 TRTSDT DATE9. 2 TRTEDT DATE9. 3 TRTSDTM DATETIME20. 4 TRTEDTM DATETIME20."},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_label","dir":"Articles","previous_headings":"","what":"xportr_label()","title":"Getting Started","text":"Please observe ADSL dataset missing many variable labels. Sometimes labels can lost using R’s function. However, CDISC compliant data set needs variable label. Using xport_label function can take specifications file label variables available. xportr_label produce warning message variable data set specification file.","code":"tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... $ RFICDTC : chr [1:306] NA NA NA NA ... $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... $ DTHDTC : chr [1:306] NA NA NA NA ... $ DTHFL : chr [1:306] NA NA NA NA ... $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... $ LDDTHGR1: chr [1:306] NA NA NA NA ... $ DTH30FL : chr [1:306] NA NA NA NA ... $ DTHA30FL: chr [1:306] NA NA NA NA ... $ DTHB30FL: chr [1:306] NA NA NA NA ... - attr(*, \"label\")= chr \"Demographics\" adsl_lbl <- adsl_xportr %>% xportr_label(var_spec, domain = \"ADSL\", \"message\") str(adsl_lbl) tibble [306 × 51] (S3: tbl_df/tbl/data.frame) $ STUDYID : chr [1:306] \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" \"CDISCPILOT01\" ... ..- attr(*, \"label\")= chr \"Study Identifier\" $ USUBJID : chr [1:306] \"01-701-1015\" \"01-701-1023\" \"01-701-1028\" \"01-701-1033\" ... ..- attr(*, \"label\")= chr \"Unique Subject Identifier\" $ SUBJID : chr [1:306] \"1015\" \"1023\" \"1028\" \"1033\" ... ..- attr(*, \"label\")= chr \"Subject Identifier for the Study\" $ RFSTDTC : chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Subject Reference Start Date/Time\" $ RFENDTC : chr [1:306] \"2014-07-02\" \"2012-09-02\" \"2014-01-14\" \"2014-04-14\" ... ..- attr(*, \"label\")= chr \"Subject Reference End Date/Time\" $ RFXSTDTC: chr [1:306] \"2014-01-02\" \"2012-08-05\" \"2013-07-19\" \"2014-03-18\" ... ..- attr(*, \"label\")= chr \"Date/Time of First Study Treatment\" $ RFXENDTC: chr [1:306] \"2014-07-02\" \"2012-09-01\" \"2014-01-14\" \"2014-03-31\" ... ..- attr(*, \"label\")= chr \"Date/Time of Last Study Treatment\" $ RFICDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date/Time of Informed Consent\" $ RFPENDTC: chr [1:306] \"2014-07-02T11:45\" \"2013-02-18\" \"2014-01-14T11:10\" \"2014-09-15\" ... ..- attr(*, \"label\")= chr \"Date/Time of End of Participation\" $ DTHDTC : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date / Time of Death\" $ DTHFL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Subject Death Flag\" $ SITEID : chr [1:306] \"701\" \"701\" \"701\" \"701\" ... ..- attr(*, \"label\")= chr \"Study Site Identifier\" $ AGE : num [1:306] 63 64 71 74 77 85 59 68 81 84 ... ..- attr(*, \"label\")= chr \"Age\" $ AGEU : chr [1:306] \"YEARS\" \"YEARS\" \"YEARS\" \"YEARS\" ... ..- attr(*, \"label\")= chr \"Age Units\" $ SEX : chr [1:306] \"F\" \"M\" \"M\" \"M\" ... ..- attr(*, \"label\")= chr \"Sex\" $ RACE : chr [1:306] \"WHITE\" \"WHITE\" \"WHITE\" \"WHITE\" ... ..- attr(*, \"label\")= chr \"Race\" $ ETHNIC : chr [1:306] \"HISPANIC OR LATINO\" \"HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" \"NOT HISPANIC OR LATINO\" ... ..- attr(*, \"label\")= chr \"Ethnicity\" $ ARMCD : chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Planned Arm Code\" $ ARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Planned Arm\" $ ACTARMCD: chr [1:306] \"Pbo\" \"Pbo\" \"Xan_Hi\" \"Xan_Lo\" ... ..- attr(*, \"label\")= chr \"Actual Arm Code\" $ ACTARM : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Description of Actual Arm\" $ COUNTRY : chr [1:306] \"USA\" \"USA\" \"USA\" \"USA\" ... ..- attr(*, \"label\")= chr \"Country\" $ DMDTC : chr [1:306] \"2013-12-26\" \"2012-07-22\" \"2013-07-11\" \"2014-03-10\" ... ..- attr(*, \"label\")= chr \"Date/Time of Collection\" $ DMDY : num [1:306] -7 -14 -8 -8 -7 -21 NA -9 -13 -7 ... ..- attr(*, \"label\")= chr \"Study Day of Collection\" $ TRT01P : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Planned Treatment for Period 01\" $ TRT01A : chr [1:306] \"Placebo\" \"Placebo\" \"Xanomeline High Dose\" \"Xanomeline Low Dose\" ... ..- attr(*, \"label\")= chr \"Actual Treatment for Period 01\" $ TRTSDTM : POSIXct[1:306], format: \"2014-01-02\" ... $ TRTSTMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"label\")= chr \"Time of First Exposure Imputation Flag\" $ TRTEDTM : POSIXct[1:306], format: \"2014-07-02 23:59:59\" ... $ TRTETMF : chr [1:306] \"H\" \"H\" \"H\" \"H\" ... ..- attr(*, \"label\")= chr \"Time of Last Exposure Imputation Flag\" $ TRTSDT : Date[1:306], format: \"2014-01-02\" ... $ TRTEDT : Date[1:306], format: \"2014-07-02\" ... $ TRTDURD : num [1:306] 182 28 180 14 183 26 NA 190 10 55 ... ..- attr(*, \"label\")= chr \"Total Duration of Trt (days)\" $ SCRFDT : Date[1:306], format: NA ... $ EOSDT : Date[1:306], format: \"2014-07-02\" ... $ EOSSTT : chr [1:306] \"COMPLETED\" \"DISCONTINUED\" \"COMPLETED\" \"DISCONTINUED\" ... ..- attr(*, \"label\")= chr \"End of Study Status\" $ FRVDT : Date[1:306], format: NA ... $ RANDDT : Date[1:306], format: \"2014-01-02\" ... $ DTHDT : Date[1:306], format: NA ... $ DTHDTF : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Date of Death Imputation Flag\" $ DTHADY : num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"label\")= chr \"Relative Day of Death\" $ LDDTHELD: num [1:306] NA NA NA NA NA NA NA NA NA NA ... ..- attr(*, \"label\")= chr \"Elapsed Days from Last Dose to Death\" $ LSTALVDT: Date[1:306], format: \"2014-07-02\" ... $ SAFFL : chr [1:306] \"Y\" \"Y\" \"Y\" \"Y\" ... ..- attr(*, \"label\")= chr \"Safety Population Flag\" $ RACEGR1 : chr [1:306] \"White\" \"White\" \"White\" \"White\" ... ..- attr(*, \"label\")= chr \"Pooled Race Group 1\" $ AGEGR1 : chr [1:306] \"18-64\" \"18-64\" \">64\" \">64\" ... ..- attr(*, \"label\")= chr \"Pooled Age Group 1\" $ REGION1 : chr [1:306] \"NA\" \"NA\" \"NA\" \"NA\" ... ..- attr(*, \"label\")= chr \"Geographic Region 1\" $ LDDTHGR1: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Last Does to Death Group\" $ DTH30FL : chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Under 30 Group\" $ DTHA30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Over 30 Group\" $ DTHB30FL: chr [1:306] NA NA NA NA ... ..- attr(*, \"label\")= chr \"Over 30 plus 30 days Group\" - attr(*, \"label\")= chr \"Demographics\" - attr(*, \"_xportr.df_arg_\")= chr \"ADSL\""},{"path":"https://atorus-research.github.io/xportr/dev/articles/xportr.html","id":"xportr_write","dir":"Articles","previous_headings":"","what":"xportr_write()","title":"Getting Started","text":"Finally, arrive exporting R data frame object xpt file xportr_write(). xpt file written directly current working directory. make interesting, put together six functions magrittr pipe, %>%. user can now apply types, length, variable labels, formats, data set label write final xpt file one pipe! Appropriate warnings messages supplied user console potential issues sending standard clinical data set validator application data reviewers. ’s ! now xpt file created R appropriate types, lengths, labels, ordering formats specification file. interested exploring custom warnings error messages well background xpt generation sure check Deep Dive User Guide. always, welcome feedback. spot bug, like see new feature, documentation unclear - submit issue xportr’s GitHub page.","code":"adsl_xportr %>% xportr_type(var_spec, \"ADSL\", \"message\") %>% xportr_length(var_spec, \"ADSL\", verbose = \"message\") %>% xportr_label(var_spec, \"ADSL\", \"message\") %>% xportr_order(var_spec, \"ADSL\", \"message\") %>% xportr_format(var_spec, \"ADSL\") %>% xportr_write(\"adsl.xpt\") ── All variables in specification file are in dataset ── ── 50 reordered in dataset ── Variable reordered in `.df`: `SITEID`, `USUBJID`, `SUBJID`, `COUNTRY`, `AGE`, `AGEU`, `AGEGR1`, `SEX`, `RACE`, `RACEGR1`, `ETHNIC`, `RFSTDTC`, `RFENDTC`, `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DMDTC`, `DMDY`, `SAFFL`, `ARM`, `ARMCD`, `ACTARM`, `ACTARMCD`, `TRT01P`, `TRT01A`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `TRTSDT`, `TRTEDT`, `DTHFL`, `DTHDTC`, `DTHDT`, `DTHDTF`, `DTHADY`, `REGION1`, `TRTDURD`, `LDDTHELD`, `LSTALVDT`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, `DTHB30FL`, `FRVDT`, `RANDDT`, `SCRFDT`, `EOSDT`, and `EOSSTT`"},{"path":"https://atorus-research.github.io/xportr/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Eli Miller. Author, maintainer. Ben Straub. Author. Zelos Zhu. Author. Ethan Brockmann. Author. Vedha Viyash. Author. Andre Verissimo. Author. Sophie Shapcott. Author. Celine Piraux. Author. Kangjie Zhang. Author. Adrian Chan. Author. Sadchla Mascary. Author. Atorus/GSK JPT. Copyright holder.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Miller E, Straub B, Zhu Z, Brockmann E, Viyash V, Verissimo , Shapcott S, Piraux C, Zhang K, Chan , Mascary S (2024). xportr: Utilities Output CDISC SDTM/ADaM XPT Files. R package version 0.3.1.9033, https://github.com/atorus-research/xportr, https://atorus-research.github.io/xportr/.","code":"@Manual{, title = {xportr: Utilities to Output CDISC SDTM/ADaM XPT Files}, author = {Eli Miller and Ben Straub and Zelos Zhu and Ethan Brockmann and Vedha Viyash and Andre Verissimo and Sophie Shapcott and Celine Piraux and Kangjie Zhang and Adrian Chan and Sadchla Mascary}, year = {2024}, note = {R package version 0.3.1.9033, https://github.com/atorus-research/xportr}, url = {https://atorus-research.github.io/xportr/}, }"},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"xportr-","dir":"","previous_headings":"","what":"Utilities to Output CDISC SDTM/ADaM XPT Files","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"Welcome xportr! designed xportr help get xpt files ready transport either clinical data set validator application regulatory agency. package functionality associate metadata information local R data frame, perform data set level validation checks convert transport v5 file(xpt). always, welcome feedback. spot bug, like see new feature, documentation unclear - submit issue xportr’s GitHub page.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"package available CRAN can installed running:","code":"install.packages(\"xportr\")"},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"development-version","dir":"","previous_headings":"Installation","what":"Development version:","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"","code":"install.packages(\"xportr\", repos = c(\"https://pharmaverse.r-universe.dev\", getOption(\"repos\")))"},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"what-is-xportr","dir":"","previous_headings":"","what":"What is xportr?","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"xportr designed clinical programmers create CDISC compliant xpt files- ADaM SDTM. Essentially, package two big components Writing xpt files well-defined metadata Checking compliance data sets. first set tools designed allow clinical programmer build CDISC compliant xpt file directly R. second set tools perform checks data sets send validators data reviewers.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"what-are-the-checks","dir":"","previous_headings":"","what":"What are the checks?","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"Variable names must start letter (underscore), comprised uppercase letters (-Z), numerals (0-9) free non-ASCII characters, symbols, underscores. Allotted length column containing character (text) data set maximum length variable used across data sets (≤ 200) Coerces variables numeric character types Display format support numeric float date/time values Variables names ≤ 8 characters. Variable labels ≤ 40 characters. Data set labels ≤ 40 characters. Presence non-ASCII characters Variable Names, Labels data set labels. NOTE: check associated messages warning.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"simple-example","dir":"","previous_headings":"","what":"Simple Example","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"Objective: Create fully compliant v5 xpt ADSL dataset developed using R. need following: Apply types Apply lengths Apply variable labels Apply formats Re-order variables Apply dataset label Write version 5 xpt file can done using well-defined specification file xportr package! First start ADSL dataset created R. example ADSL dataset contains 306 observations 51 variables. created dummy specification file called ADaM_spec.xlsx found specs folder package. can use system.file(file.path(\"specs/\", \"ADaM_spec.xlsx\"), package = \"xportr\") access file. xportr_ function written way take part specification file apply piece dataset. Setting verbose = \"warn\" send appropriate warning message console. suppressed warning sake brevity. xportr_metadata() function can reduce duplication setting variable specification domain explicitly top pipeline. like use verbose argument, need set function call. Furthermore, ’re calling xportr functions common metadata verbosity, can shorten simply using xportr(). ’s ! now xpt file created R appropriate types, lengths, labels, ordering formats. Please check Get Started information detailed walk xportr_ function. talks Pharma companies involved {pharmaverse} enhance package play well downstream upstream packages.","code":"library(dplyr) library(xportr) data(\"adsl_xportr\") ADSL <- adsl_xportr spec_path <- system.file(file.path(\"specs\", \"ADaM_spec.xlsx\"), package = \"xportr\") var_spec <- readxl::read_xlsx(spec_path, sheet = \"Variables\") %>% dplyr::rename(type = \"Data Type\") %>% dplyr::rename_with(tolower) dataset_spec <- readxl::read_xlsx(spec_path, sheet = \"Datasets\") %>% dplyr::rename(label = \"Description\") %>% dplyr::rename_with(tolower) ADSL %>% xportr_metadata(var_spec, \"ADSL\") %>% xportr_type(verbose = \"warn\") %>% xportr_length(verbose = \"warn\") %>% xportr_label(verbose = \"warn\") %>% xportr_order(verbose = \"warn\") %>% xportr_format() %>% xportr_df_label(dataset_spec, \"ADSL\") %>% xportr_write(\"adsl.xpt\") ADSL %>% xportr_metadata(var_spec, \"ADSL\", verbose = \"warn\") %>% xportr_type() %>% xportr_length() %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(\"adsl.xpt\") xportr( .df = ADSL, var_metadata = var_spec, df_metadata = dataset_spec, domain = \"ADSL\", verbose = \"warn\", \"adsl.xpt\" )"},{"path":"https://atorus-research.github.io/xportr/dev/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Utilities to Output CDISC SDTM/ADaM XPT Files","text":"package developed jointly GSK Atorus.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/pull_request_template.html","id":"thank-you-for-your-pull-request","dir":"","previous_headings":"","what":"Thank you for your Pull Request!","title":"NA","text":"developed Pull Request template aid reviewers. Completing tasks helps ensure reviewers can maximize time code well making sure xportr codebase remains robust consistent.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/pull_request_template.html","id":"the-scope-of-xportr","dir":"","previous_headings":"","what":"The scope of {xportr}","title":"NA","text":"xportr’s scope enable R users write submission compliant xpt files can delivered Health Authority downstream validation software programs. see labels, lengths, types, ordering formats dataset specification object (SDTM ADaM) primary focus. also see messaging warnings users around applying information specification file primary focus. Please make sure Pull Request meets scope {xportr}. Pull Request moves beyond scope, please get touch xportr team slack create issue discuss. Please check task box acknowledgment completed task. checklist part Github Action workflows Pull Request merged main branch checked task.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/pull_request_template.html","id":"changes-description","dir":"","previous_headings":"","what":"Changes Description","title":"NA","text":"(descriptions changes)","code":""},{"path":"https://atorus-research.github.io/xportr/dev/pull_request_template.html","id":"task-list","dir":"","previous_headings":"","what":"Task List","title":"NA","text":"spirit xportr met Pull Request Place Closes # beginning Pull Request Title (Use Edit button top-right need update) Summary changes filled Changes Description. Can removed left blank changes minor/self-explanatory. Code formatted according tidyverse style guide. Use styler package functions style files accordingly. New functions arguments follow established convention found Wiki. Updated relevant unit tests written new unit tests. See Wiki conventions used package. Creation/updated relevant roxygen headers examples. See Wiki conventions used package. Run devtools::document() .Rd files man folder NAMESPACE file project root updated appropriately Run pkgdown::build_site() check affected examples displayed correctly new/updated functions occur “Reference” page. Update NEWS.md changes pertain user-facing function (.e. @export tag) documentation aimed users (rather developers) NEWS.md entry go # xportr development version section. Don’t worry updating version auto-updated using vbump.yaml CI. Address updates needed vignettes /templates. Link issue Development Panel closes successful merging. developer responsible fixing merge conflicts Reviewer. Pat back job well done! Much love accomplishment!","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/adsl_xportr.html","id":null,"dir":"Reference","previous_headings":"","what":"Analysis Dataset Subject Level — adsl_xportr","title":"Analysis Dataset Subject Level — adsl_xportr","text":"example dataset containing subject level data","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/adsl_xportr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Analysis Dataset Subject Level — adsl_xportr","text":"","code":"data(\"adsl_xportr\")"},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/reference/adsl_xportr.html","id":"adsl-xportr","dir":"Reference","previous_headings":"","what":"adsl_xportr","title":"Analysis Dataset Subject Level — adsl_xportr","text":"data frame 306 rows 51 columns: STUDYID Study Identifier USUBJID Unique Subject Identifier SUBJID Subject Identifier Study RFSTDTC Subject Reference Start Date/Time RFENDTC Subject Reference End Date/Time RFXSTDTC Date/Time First Study Treatment RFXENDTC Date/Time Last Study Treatment RFICDTC Date/Time Informed Consent RFPENDTC Date/Time End Participation DTHDTC Date/Time Death DTHFL Subject Death Flag SITEID Study Site Identifier AGE Age AGEU Age Units SEX Sex RACE Race ETHNIC Ethnicity ARMCD Planned Arm Code ARM Description Planned Arm ACTARMCD Actual Arm Code ACTARM Description Actual Arm COUNTRY Country DMDTC Date/Time Collection DMDY Study Day Collection TRT01P Planned Treatment Period 01 TRT01A Actual Treatment Period 01 TRTSDTM Datetime First Exposure Treatment TRTSTMF Time First Exposure Imputation Flag TRTEDTM Datetime Last Exposure Treatment TRTETMF Time Last Exposure Imputation Flag TRTSDT Date First Exposure Treatment TRTEDT Date Last Exposure Treatment TRTDURD Total Treatment Duration (Days) SCRFDT Screen Failure Date EOSDT End Study Date EOSSTT End Study Status FRVDT Final Retrieval Visit Date RANDDT Date Randomization DTHDT Date Death DTHDTF Date Death Imputation Flag DTHADY Relative Day Death LDDTHELD Elapsed Days Last Dose Death LSTALVDT Date Last Known Alive SAFFL Safety Population Flag RACEGR1 Pooled Race Group 1 AGEGR1 Pooled Age Group 1 REGION1 Geographic Region 1 LDDTHGR1 Last Dose Death - Days Elapsed Group 1 DTH30FL Death Within 30 Days Last Trt Flag DTHA30FL Death 30 Days Last Trt Flag DTHB30FL Death Within 30 Days First Trt Flag","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/adsl_xportr.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Analysis Dataset Subject Level — adsl_xportr","text":"Dataset created admiral::use_ad_template(\"adsl\")","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/dataset_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"Example Dataset Specification — dataset_spec","title":"Example Dataset Specification — dataset_spec","text":"Example Dataset Specification","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/dataset_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example Dataset Specification — dataset_spec","text":"","code":"data(\"dataset_spec\")"},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/reference/dataset_spec.html","id":"dataset-spec","dir":"Reference","previous_headings":"","what":"dataset_spec","title":"Example Dataset Specification — dataset_spec","text":"data frame 1 row 9 columns: Dataset Dataset Description Dataset description Class Dataset class Structure Logical, indicating specific structure Purpose Purpose dataset Key, Variables Join Key variables dataset Repeating Indicates dataset repeating Reference Data Reference Data Comment Additional comment","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/expect_attr_width.html","id":null,"dir":"Reference","previous_headings":"","what":"Custom expect function to test result of xportr_length — expect_attr_width","title":"Custom expect function to test result of xportr_length — expect_attr_width","text":"Custom expect function test result xportr_length","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/expect_attr_width.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Custom expect function to test result of xportr_length — expect_attr_width","text":"","code":"expect_attr_width(result, metadata_length)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/expect_attr_width.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Custom expect function to test result of xportr_length — expect_attr_width","text":"result data.frame width attribute columns. metadata_length vector numeric expected lengths column width.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/expect_attr_width.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Custom expect function to test result of xportr_length — expect_attr_width","text":"first argument, invisibly.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Set variable specifications and domain — xportr_metadata","title":"Set variable specifications and domain — xportr_metadata","text":"Sets metadata /domain dataset way can accessed xportr functions. used start xportr pipeline, removes need set metadata domain step individually. details format metadata, see 'Metadata' section function question.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set variable specifications and domain — xportr_metadata","text":"","code":"xportr_metadata(.df, metadata = NULL, domain = NULL, verbose = NULL)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set variable specifications and domain — xportr_metadata","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none'","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set variable specifications and domain — xportr_metadata","text":".df dataset metadata domain attributes set","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/metadata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set variable specifications and domain — xportr_metadata","text":"","code":"metadata <- data.frame( dataset = \"test\", variable = c(\"Subj\", \"Param\", \"Val\", \"NotUsed\"), type = c(\"numeric\", \"character\", \"numeric\", \"character\"), format = NA, order = c(1, 3, 4, 2) ) adlb <- data.frame( Subj = as.character(123, 456, 789), Different = c(\"a\", \"b\", \"c\"), Val = c(\"1\", \"2\", \"3\"), Param = c(\"param1\", \"param2\", \"param3\") ) xportr_metadata(adlb, metadata, \"test\") #> Subj Different Val Param #> 1 123 a 1 param1 #> 2 123 b 2 param2 #> 3 123 c 3 param3 library(magrittr) adlb %>% xportr_metadata(metadata, \"test\") %>% xportr_type() %>% xportr_order() #> #> ── Variable type mismatches found. ── #> #> ✔ 2 variables coerced #> #> ── 1 variables not in spec and moved to end ── #> #> ── 2 reordered in dataset ── #> #> Subj Param Val Different #> 1 123 param1 1 a #> 2 123 param2 2 b #> 3 123 param3 3 c"},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","title":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","text":"Minimal metadata data frame mock ADaM dataset","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","text":"","code":"minimal_metadata( dataset = FALSE, length = FALSE, label = FALSE, type = FALSE, format = FALSE, order = FALSE, dataset_name = \"adsl\", var_names = NULL )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","text":"dataset Flag indicates dataset column included. length Flag indicates length column included. label Flag indicates label column included. type Flag indicates type column included. format Flag indicates format column included. order Flag indicates order column included. dataset_name String name domain. var_names Character vector defines variables (rows) keep","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Minimal metadata data frame mock for a ADaM dataset — minimal_metadata","text":"metadata data.frame","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Minimal data frame mock of a valid ADaM dataset — minimal_table","title":"Minimal data frame mock of a valid ADaM dataset — minimal_table","text":"function used tests.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Minimal data frame mock of a valid ADaM dataset — minimal_table","text":"","code":"minimal_table(n_rows = 3, cols = c(\"x\", \"y\"))"},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Minimal data frame mock of a valid ADaM dataset — minimal_table","text":"n_rows Numeric value indicates number rows data frame cols Vector characters indicates columns return. default x y returned numeric contents.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/minimal_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Minimal data frame mock of a valid ADaM dataset — minimal_table","text":"data.frame mimicking valid ADaM dataset.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/multiple_vars_in_spec_helper.html","id":null,"dir":"Reference","previous_headings":"","what":"Test if multiple vars in spec will result in warning message — multiple_vars_in_spec_helper","title":"Test if multiple vars in spec will result in warning message — multiple_vars_in_spec_helper","text":"Test multiple vars spec result warning message","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/multiple_vars_in_spec_helper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test if multiple vars in spec will result in warning message — multiple_vars_in_spec_helper","text":"","code":"multiple_vars_in_spec_helper(fun)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/multiple_vars_in_spec_helper2.html","id":null,"dir":"Reference","previous_headings":"","what":"Test if multiple vars in spec with appropriate — multiple_vars_in_spec_helper2","title":"Test if multiple vars in spec with appropriate — multiple_vars_in_spec_helper2","text":"Test multiple vars spec appropriate","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/multiple_vars_in_spec_helper2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test if multiple vars in spec with appropriate — multiple_vars_in_spec_helper2","text":"","code":"multiple_vars_in_spec_helper2(fun)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/var_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"Example Dataset Variable Specification — var_spec","title":"Example Dataset Variable Specification — var_spec","text":"Example Dataset Variable Specification","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/var_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example Dataset Variable Specification — var_spec","text":"","code":"data(\"var_spec\")"},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/reference/var_spec.html","id":"var-spec","dir":"Reference","previous_headings":"","what":"var_spec","title":"Example Dataset Variable Specification — var_spec","text":"data frame 216 rows 19 columns: Order Order variable Dataset Dataset Variable Variable Label Variable Label Data Type Data Type Length Variable Length Significant Digits Significant Digits Format Variable Format Mandatory Mandatory Variable Flag Assigned Value Variable Assigned Value Codelist Variable Codelist Common Common Variable Flag Origin Variable Origin Pages Pages Method Variable Method Predecessor Variable Predecessor Role Variable Role Comment Comment Developer Notes Developer Notes","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr-package.html","id":null,"dir":"Reference","previous_headings":"","what":"The xportr package — xportr-package","title":"The xportr package — xportr-package","text":"xportr designed clinical workflow friendly method outputting CDISC complaint data sets R, XPT version 5 files. designed options mind allow flexible setting options allowing projects system administrators set sensible defaults organizations workflows. list options can set customize xportr works environment.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr-package.html","id":"xportr-options","dir":"Reference","previous_headings":"","what":"xportr options","title":"The xportr package — xportr-package","text":"xportr.df_domain_name - name domain \"name\" column dataset metadata. Default: \"dataset\" xportr.df_label - column noting dataset label dataset metadata. Default: \"label\" xportr.domain_name - name domain \"name\" column variable metadata. Default: \"dataset\" xportr.variable_name - name variable \"name\" variable metadata. Default: \"variable\" xportr.type_name - name variable type column variable metadata. Default: \"type\" xportr.label - name variable label column variable metadata. Default: \"label\" xportr.length - name variable length column variable metadata. Default: \"length\" xportr.order_name - name variable order column variable metadata. Default: \"order\" xportr.format_name - name variable format column variable metadata. Default: \"format\" xportr.format_verbose - default argument 'verbose' argument xportr_format. Default: \"none\" xportr.label_verbose - default argument 'verbose' argument xportr_label. Default: \"none\" xportr.length_verbose - default argument 'verbose' argument xportr_length. Default: \"none\" xportr.type_verbose - default argument 'verbose' argument xportr_type. Default: \"none\" xportr.character_types - default character vector used explicitly coerce R classes character XPT types. Default: \"character\" xportr.character_metadata_types - default character vector used explicitly coerce R classes character XPT types. Default: c(\"character\", \"char\", \"text\", \"date\", \"posixct\", \"posixt\", \"datetime\", \"time\", \"partialdate\", \"partialtime\", \"partialdatetime\", \"incompletedatetime\", \"durationdatetime\", \"intervaldatetime\")` xportr.numeric_metadata_types - default character vector used explicitly coerce R classes numeric XPT types. Default: c(\"integer\", \"numeric\", \"num\", \"float\") xportr.numeric_types - default character vector used explicitly coerce R classes numeric XPT types. Default: c(\"integer\", \"float\", \"numeric\", \"posixct\", \"posixt\", \"time\", \"date\")","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr-package.html","id":"updating-options","dir":"Reference","previous_headings":"","what":"Updating Options","title":"The xportr package — xportr-package","text":"single session, option can changed option( = ) change option single projects across sessions projects, place options update .Rprofile project directory. change option user across sessions, place options update .Rprofile file users home directory. change option users R environment, place options update .Rprofile.site file R home directory.","code":""},{"path":[]},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"The xportr package — xportr-package","text":"Maintainer: Eli Miller Eli.Miller@AtorusResearch.com (ORCID) Authors: Ben Straub Zelos Zhu Ethan Brockmann Vedha Viyash Andre Verissimo Sophie Shapcott Celine Piraux Kangjie Zhang Adrian Chan Sadchla Mascary contributors: Atorus/GSK JPT [copyright holder]","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrapper to apply all core xportr functions and write xpt — xportr","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":"Wrapper apply core xportr functions write xpt","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":"","code":"xportr( .df, var_metadata = NULL, df_metadata = NULL, domain = NULL, verbose = NULL, path, strict_checks = FALSE )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":".df data frame CDISC standard. var_metadata data frame containing variable level metadata df_metadata data frame containing dataset level metadata. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' path Path transport file written. File name sans used xpt name. strict_checks TRUE, xpt validation report errors write dataset. FALSE, xpt validation report warnings continue writing dataset. Defaults FALSE","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":"Returns input dataframe invisibly","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Wrapper to apply all core xportr functions and write xpt — xportr","text":"","code":"data(\"adsl_xportr\", \"dataset_spec\", \"var_spec\") adsl <- adsl_xportr library(magrittr) test_dir <- tempdir() pipeline_path <- file.path(test_dir, \"adslpipe.xpt\") xportr_path <- file.path(test_dir, \"adslxptr.xpt\") dataset_spec_low <- setNames(dataset_spec, tolower(names(dataset_spec))) names(dataset_spec_low)[[2]] <- \"label\" var_spec_low <- setNames(var_spec, tolower(names(var_spec))) names(var_spec_low)[[5]] <- \"type\" adsl %>% xportr_metadata(var_spec_low, \"ADSL\", verbose = \"none\") %>% xportr_type() %>% xportr_length() %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec_low) %>% xportr_write(pipeline_path) #> ── Variable lengths missing from metadata. ── #> #> ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` #> #> ── Variable labels missing from metadata. ── #> #> ✔ 30 labels skipped #> #> ── 30 variables not in spec and moved to end ── #> #> ── 42 reordered in dataset ── #> # `xportr()` can be used to apply a whole pipeline at once xportr( adsl, var_metadata = var_spec_low, df_metadata = dataset_spec_low, domain = \"ADSL\", verbose = \"none\", path = xportr_path ) #> ── Variable lengths missing from metadata. ── #> #> ✔ 30 lengths resolved `RFXSTDTC`, `RFXENDTC`, `RFICDTC`, `RFPENDTC`, `DTHDTC`, `ARMCD`, `ACTARMCD`, `ACTARM`, `COUNTRY`, `DMDTC`, `DMDY`, `TRTSDTM`, `TRTSTMF`, `TRTEDTM`, `TRTETMF`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `DTHDTF`, `DTHADY`, `LDDTHELD`, `LSTALVDT`, `RACEGR1`, `REGION1`, `LDDTHGR1`, `DTH30FL`, `DTHA30FL`, and `DTHB30FL` #> #> ── Variable labels missing from metadata. ── #> #> ✔ 30 labels skipped #> #> ── 30 variables not in spec and moved to end ── #> #> ── 42 reordered in dataset ── #>"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign Dataset Label — xportr_df_label","title":"Assign Dataset Label — xportr_df_label","text":"Assigns dataset label dataset level metadata given data frame. stored 'label' attribute dataframe.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign Dataset Label — xportr_df_label","text":"","code":"xportr_df_label(.df, metadata = NULL, domain = NULL, metacore = deprecated())"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign Dataset Label — xportr_df_label","text":".df data frame CDISC standard. metadata data frame containing dataset. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign Dataset Label — xportr_df_label","text":"Data frame label attributes.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Assign Dataset Label — xportr_df_label","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments two columns must present: Domain Name - passed 'xportr.df_domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Label Name - passed 'xportr.df_label' option. Default: \"label\". Character values update 'label' attribute dataframe passed haven::write_xpt note label.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_df_label.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assign Dataset Label — xportr_df_label","text":"","code":"adsl <- data.frame( USUBJID = c(1001, 1002, 1003), SITEID = c(001, 002, 003), AGE = c(63, 35, 27), SEX = c(\"M\", \"F\", \"M\") ) metadata <- data.frame( dataset = c(\"adsl\", \"adae\"), label = c(\"Subject-Level Analysis\", \"Adverse Events Analysis\") ) adsl <- xportr_df_label(adsl, metadata, domain = \"adsl\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign SAS Format — xportr_format","title":"Assign SAS Format — xportr_format","text":"Assigns SAS format variable level metadata given data frame. format found given variable, set empty character vector. stored 'format.sas' attribute.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign SAS Format — xportr_format","text":"","code":"xportr_format( .df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign SAS Format — xportr_format","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign SAS Format — xportr_format","text":"Data frame SASformat attributes variable.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"format-checks","dir":"Reference","previous_headings":"","what":"Format Checks","title":"Assign SAS Format — xportr_format","text":"function carries series basic checks ensure formats applied make sense. Note, 'type' message generated depend value passed verbose argument: 'stop' producing error, 'warn' producing warning, 'message' producing message. value 'none' output messages. variable suffix DT, DTM, TM (indicating numeric date/time variable) message shown format associated . variable character message shown $ prefix associated format. variable character message shown associated format greater 31 characters (excluding $). variable numeric message shown $ prefix associated format. variable numeric message shown associated format greater 32 characters. formats checked list formats considered 'standard' part ADaM dataset. Note, however, list exhaustive (feasible check functions within scope package). format found 'standard' list, message created advising user check.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Assign SAS Format — xportr_format","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments three columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Format Name - passed 'xportr.format_name' option. Default: \"format\". Character values update 'format.sas' attribute column. passed haven::write note format. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_format.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assign SAS Format — xportr_format","text":"","code":"adsl <- data.frame( USUBJID = c(1001, 1002, 1003), BRTHDT = c(1, 1, 2) ) metadata <- data.frame( dataset = c(\"adsl\", \"adsl\"), variable = c(\"USUBJID\", \"BRTHDT\"), format = c(NA, \"DATE9.\") ) adsl <- xportr_format(adsl, metadata, domain = \"adsl\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign Variable Label — xportr_label","title":"Assign Variable Label — xportr_label","text":"Assigns variable label variable level metadata given data frame. function give detect label greater 40 characters allowed XPT v5. labels present variable assigned empty character value. Labels stored 'label' attribute column.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign Variable Label — xportr_label","text":"","code":"xportr_label( .df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign Variable Label — xportr_label","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign Variable Label — xportr_label","text":"Data frame label attributes variable.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"messaging","dir":"Reference","previous_headings":"","what":"Messaging","title":"Assign Variable Label — xportr_label","text":"label_log() primary messaging tool xportr_label(). columns present '.df' noted metadata, assigned label message generated noting number variables assigned label. variables found metadata value passed 'verbose' argument 'stop', 'warn', 'message', message generated detailing variables missing metadata.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Assign Variable Label — xportr_label","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments three columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata. Variable Label - passed 'xportr.label' option. Default: \"label\". character values update 'label' attribute column. passed haven::write note label.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_label.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assign Variable Label — xportr_label","text":"","code":"adsl <- data.frame( USUBJID = c(1001, 1002, 1003), SITEID = c(001, 002, 003), AGE = c(63, 35, 27), SEX = c(\"M\", \"F\", \"M\") ) metadata <- data.frame( dataset = \"adsl\", variable = c(\"USUBJID\", \"SITEID\", \"AGE\", \"SEX\"), label = c(\"Unique Subject Identifier\", \"Study Site Identifier\", \"Age\", \"Sex\") ) adsl <- xportr_label(adsl, metadata, domain = \"adsl\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":null,"dir":"Reference","previous_headings":"","what":"Assign SAS Length — xportr_length","title":"Assign SAS Length — xportr_length","text":"Assigns SAS length specified data frame, either metadata object based calculated maximum data length. length present variable length value set maximum data length character columns, 8 non-character columns. value stored 'width' attribute column.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assign SAS Length — xportr_length","text":"","code":"xportr_length( .df, metadata = NULL, domain = NULL, verbose = NULL, length_source = c(\"metadata\", \"data\"), metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assign SAS Length — xportr_length","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' length_source Choose assigned length either metadata data. \"metadata\" specified, assigned length metadata length. \"data\" specified, assigned length determined calculated maximum data length. Permitted Values: \"metadata\", \"data\" metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assign SAS Length — xportr_length","text":"Data frame SAS default length attributes variable.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"messaging","dir":"Reference","previous_headings":"","what":"Messaging","title":"Assign SAS Length — xportr_length","text":"length_log primary messaging tool xportr_length. columns present '.df' noted metadata, assigned length message generated noting number variables assigned length. variables found metadata value passed 'verbose' argument 'stop', 'warn', 'message', message generated detailing variables missing metadata.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Assign SAS Length — xportr_length","text":"argument passed 'metadata' argument can either {metacore} object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments three columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata. Variable Label - passed 'xportr.length' option. Default: \"length\". numeric values update 'width' attribute column. passed haven::write note variable length.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_length.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assign SAS Length — xportr_length","text":"","code":"adsl <- data.frame( USUBJID = c(1001, 1002, 1003), BRTHDT = c(1, 1, 2) ) metadata <- data.frame( dataset = c(\"adsl\", \"adsl\"), variable = c(\"USUBJID\", \"BRTHDT\"), length = c(10, 8) ) adsl <- xportr_length(adsl, metadata, domain = \"adsl\", length_source = \"metadata\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Get or set xportr options — xportr_options","title":"Get or set xportr options — xportr_options","text":"two mechanisms working options xportr. One options() function, part base R, xportr_options() function, xportr package. reason two mechanisms legacy code scoping. options() function sets options globally, duration R process. getOption() function retrieves value option. xportr related options type prefixed \"xportr.\".","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get or set xportr options — xportr_options","text":"","code":"xportr_options(...)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get or set xportr options — xportr_options","text":"... Options set, form name = value character vector option names.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"options-with-options-","dir":"Reference","previous_headings":"","what":"Options with options()","title":"Get or set xportr options — xportr_options","text":"xportr.df_domain_name defaults \"dataset\" xportr.df_label defaults \"label\" xportr.domain_name defaults \"dataset\" xportr.variable_name defaults \"variable\" xportr.type_name defaults \"type\" xportr.label defaults \"label\" xportr.length defaults \"length\" xportr.order_name defaults \"order\" xportr.format_name defaults \"format\" xportr.format_verbose defaults \"none\" xportr.label_verbose defaults \"none\" xportr.length_verbose defaults \"none\" xportr.type_verbose defaults \"label\" xportr.character_types defaults \"character\" xportr.character_metadata_types defaults c(\"character\", \"char\", \"text\", \"date\", \"posixct\", \"posixt\", \"datetime\", \"time\", \"partialdate\", \"partialtime\", \"partialdatetime\", \"incompletedatetime\", \"durationdatetime\", \"intervaldatetime\") xportr.numeric_metadata_types defaults c(\"integer\", \"numeric\", \"num\", \"float\") xportr.numeric_types defaults c(\"integer\", \"float\", \"numeric\", \"posixct\", \"posixt\", \"time\", \"date\")","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"options-with-xportr-options-","dir":"Reference","previous_headings":"","what":"Options with xportr_options()","title":"Get or set xportr options — xportr_options","text":"Alternative options(), xportr_options() function can used set options. xportr_options() function also returns current options character vector options keys passed . nothing passed , returns state xportr options.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get or set xportr options — xportr_options","text":"","code":"xportr_options(\"xportr.df_label\") #> $xportr.df_label #> [1] \"label\" #> xportr_options(xportr.df_label = \"data_label\", xportr.label = \"custom_label\") xportr_options(c(\"xportr.label\", \"xportr.df_label\")) #> $xportr.label #> [1] \"custom_label\" #> #> $xportr.df_label #> [1] \"data_label\" #> xportr_options() #> $xportr.df_domain_name #> [1] \"dataset\" #> #> $xportr.df_label #> [1] \"data_label\" #> #> $xportr.domain_name #> [1] \"dataset\" #> #> $xportr.variable_name #> [1] \"variable\" #> #> $xportr.type_name #> [1] \"type\" #> #> $xportr.label #> [1] \"custom_label\" #> #> $xportr.length #> [1] \"length\" #> #> $xportr.order_name #> [1] \"order\" #> #> $xportr.format_name #> [1] \"format\" #> #> $xportr.format_verbose #> [1] \"none\" #> #> $xportr.label_verbose #> [1] \"none\" #> #> $xportr.length_verbose #> [1] \"none\" #> #> $xportr.type_verbose #> [1] \"none\" #> #> $xportr.character_types #> [1] \"character\" #> #> $xportr.character_metadata_types #> [1] \"character\" \"char\" \"text\" #> [4] \"date\" \"posixct\" \"posixt\" #> [7] \"datetime\" \"time\" \"partialdate\" #> [10] \"partialtime\" \"partialdatetime\" \"incompletedatetime\" #> [13] \"durationdatetime\" \"intervaldatetime\" #> #> $xportr.numeric_metadata_types #> [1] \"integer\" \"numeric\" \"num\" \"float\" #> #> $xportr.numeric_types #> [1] \"integer\" \"float\" \"numeric\" \"posixct\" \"posixt\" \"time\" \"date\" #>"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options_list.html","id":null,"dir":"Reference","previous_headings":"","what":"A list with all the supported options of xportr — xportr_options_list","title":"A list with all the supported options of xportr — xportr_options_list","text":"internal list supported options xportr defaults","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A list with all the supported options of xportr — xportr_options_list","text":"","code":"xportr_options_list"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_options_list.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"A list with all the supported options of xportr — xportr_options_list","text":"object class list length 17.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":null,"dir":"Reference","previous_headings":"","what":"Order variables of a dataset according to Spec — xportr_order","title":"Order variables of a dataset according to Spec — xportr_order","text":"dplyr::arrange() function used order columns dataframe. variables missing order value appended end dataframe variables order.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Order variables of a dataset according to Spec — xportr_order","text":"","code":"xportr_order( .df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Order variables of a dataset according to Spec — xportr_order","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Order variables of a dataset according to Spec — xportr_order","text":"Dataframe re-ordered according spec","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"messaging","dir":"Reference","previous_headings":"","what":"Messaging","title":"Order variables of a dataset according to Spec — xportr_order","text":"var_ord_msg() primary messaging tool xportr_order(). two primary messages output var_ord_msg(). first \"moved\" variables. variables found metadata file moved end dataset. message generated noting number, , variables moved end dataset. variables moved, 'verbose' argument 'stop', 'warn', 'message', message generated detailing variables moved. second primary message number variables dataset, correct order. message generated noting number, , variables reordered. variables reordered, 'verbose' argument 'stop', 'warn', 'message', message generated detailing variables reordered.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Order variables of a dataset according to Spec — xportr_order","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments three columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata. Variable Order - passed 'xportr.order_name' option. Default: \"order\". values used arrange order variables. values order metadata numeric, coerced prevent alphabetical sorting numeric values.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_order.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Order variables of a dataset according to Spec — xportr_order","text":"","code":"adsl <- data.frame( BRTHDT = c(1, 1, 2), STUDYID = c(\"mid987650\", \"mid987650\", \"mid987650\"), TRT01A = c(\"Active\", \"Active\", \"Placebo\"), USUBJID = c(1001, 1002, 1003) ) metadata <- data.frame( dataset = c(\"adsl\", \"adsl\", \"adsl\", \"adsl\"), variable = c(\"STUDYID\", \"USUBJID\", \"TRT01A\", \"BRTHDT\"), order = 1:4 ) adsl <- xportr_order(adsl, metadata, domain = \"adsl\") #> ── All variables in specification file are in dataset ── #> #> ── 3 reordered in dataset ── #>"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":null,"dir":"Reference","previous_headings":"","what":"Split xpt file output — xportr_split","title":"Split xpt file output — xportr_split","text":"Per FDA Study Data Technical Conformance Guide(https://www.fda.gov/media/88173/download) section 3.3.2, dataset files sizes exceed 5 GB. datasets large enough, split based variable. example, laboratory readings ADLB can split LBCAT split hematology chemistry data.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split xpt file output — xportr_split","text":"","code":"xportr_split(.df, split_by = NULL)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split xpt file output — xportr_split","text":".df data frame CDISC standard. split_by quoted variable passed base::split().","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split xpt file output — xportr_split","text":"data frame additional attribute added xportr_write() knows split data frame.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Split xpt file output — xportr_split","text":"function tell xportr_write() split data frame based variable passed split_by. written, file name prepended number uniqueness. files noted Reviewer Guides per CDISC guidance note split files.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_split.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split xpt file output — xportr_split","text":"","code":"adlb <- data.frame( USUBJID = c(1001, 1002, 1003), LBCAT = c(\"HEMATOLOGY\", \"HEMATOLOGY\", \"CHEMISTRY\") ) adlb <- xportr_split(adlb, \"LBCAT\")"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce variable type — xportr_type","title":"Coerce variable type — xportr_type","text":"XPT v5 datasets data types character numeric. xportr_type attempts collapse R classes two XPT types. 'xportr.character_types' option used explicitly collapse class column character using .character. Similarly, 'xportr.numeric_types' collapse column numeric type. type passed variable, assumed numeric coerced .numeric().","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce variable type — xportr_type","text":"","code":"xportr_type( .df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce variable type — xportr_type","text":".df data frame CDISC standard. metadata data frame containing variable level metadata. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. verbose action function takes action taken dataset function validation finds issue. See 'Messaging' section details. Options 'stop', 'warn', 'message', 'none' metacore Previously used pass metadata now renamed metadata","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coerce variable type — xportr_type","text":"Returns modified table.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Coerce variable type — xportr_type","text":"Certain care taken using timing variables. R serializes dates based reference date 01/01/1970 XPT uses 01/01/1960. can result dates 10 years outputting R XPT using date class. reason, xportr try determine happen variables appear used denote time.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"messaging","dir":"Reference","previous_headings":"","what":"Messaging","title":"Coerce variable type — xportr_type","text":"type_log() primary messaging tool xportr_type(). number column types mismatch reported type metadata, , reported xportr_type(). type mismatches, 'verbose' argument 'stop', 'warn', 'message', mismatch detailed actual type data type noted metadata.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Coerce variable type — xportr_type","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments four columns must present: Domain Name - passed 'xportr.domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Variable Name - passed 'xportr.variable_name' option. Default: \"variable\". used match columns '.df' argument metadata. Variable Type - passed 'xportr.type_name'. Default: \"type\". used note XPT variable \"type\" options numeric character. (Option ) Character Types - list classes explicitly coerced XPT Character type. Default: c( \"character\", \"char\", \"text\", \"date\", \"posixct\", \"posixt\", \"datetime\", \"time\", \"partialdate\", \"partialtime\", \"partialdatetime\", \"incompletedatetime\", \"durationdatetime\", \"intervaldatetime\")` (Option ) Numeric Types - list classes explicitly coerced XPT numeric type. Default: c(\"integer\", \"numeric\", \"num\", \"float\")","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coerce variable type — xportr_type","text":"","code":"metadata <- data.frame( dataset = \"test\", variable = c(\"Subj\", \"Param\", \"Val\", \"NotUsed\"), type = c(\"numeric\", \"character\", \"numeric\", \"character\") ) .df <- data.frame( Subj = as.character(123, 456, 789), Different = c(\"a\", \"b\", \"c\"), Val = c(\"1\", \"2\", \"3\"), Param = c(\"param1\", \"param2\", \"param3\") ) df2 <- xportr_type(.df, metadata, \"test\") #> ── Variable type mismatches found. ── #> #> ✔ 2 variables coerced"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":null,"dir":"Reference","previous_headings":"","what":"Write xpt v5 transport file — xportr_write","title":"Write xpt v5 transport file — xportr_write","text":"Writes local data frame SAS transport file version 5. SAS transport format open format, required submission data FDA.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write xpt v5 transport file — xportr_write","text":"","code":"xportr_write( .df, path, metadata = NULL, domain = NULL, strict_checks = FALSE, label = deprecated() )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write xpt v5 transport file — xportr_write","text":".df data frame write. path Path transport file written. File name sans used xpt name. metadata data frame containing dataset. See 'Metadata' section details. domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used subset metadata object. strict_checks TRUE, xpt validation report errors write dataset. FALSE, xpt validation report warnings continue writing dataset. Defaults FALSE label Previously used set Dataset label. Use metadata argument set dataset label.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write xpt v5 transport file — xportr_write","text":"data frame. xportr_write() returns input data invisibly.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Write xpt v5 transport file — xportr_write","text":"Variable dataset labels stored \"label\" attribute. SAS format stored \"SASformat\" attribute. SAS type based metadata attribute.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"metadata","dir":"Reference","previous_headings":"","what":"Metadata","title":"Write xpt v5 transport file — xportr_write","text":"argument passed 'metadata' argument can either metacore object, data.frame containing data listed . metacore used, changes options required. data.frame 'metadata' arguments two columns must present: Domain Name - passed 'xportr.df_domain_name' option. Default: \"dataset\". column subset 'domain' argument function. Label Name - passed 'xportr.df_label' option. Default: \"label\". Character values update 'label' attribute dataframe passed haven::write_xpt note label.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xportr_write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write xpt v5 transport file — xportr_write","text":"","code":"adsl <- data.frame( SUBL = as.character(123, 456, 789), DIFF = c(\"a\", \"b\", \"c\"), VAL = c(\"1\", \"2\", \"3\"), PARAM = c(\"param1\", \"param2\", \"param3\") ) var_spec <- data.frame( dataset = \"adsl\", label = \"Subject-Level Analysis Dataset\", data_label = \"ADSL\" ) xportr_write(adsl, path = paste0(tempdir(), \"/adsl.xpt\"), domain = \"adsl\", metadata = var_spec, strict_checks = FALSE )"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xpt_validate.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate Dataset Can be Written to xpt — xpt_validate","title":"Validate Dataset Can be Written to xpt — xpt_validate","text":"Function used validate dataframes sent haven::write_xpt writing.","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xpt_validate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate Dataset Can be Written to xpt — xpt_validate","text":"","code":"xpt_validate(data)"},{"path":"https://atorus-research.github.io/xportr/dev/reference/xpt_validate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate Dataset Can be Written to xpt — xpt_validate","text":"data Dataset exported xpt file","code":""},{"path":"https://atorus-research.github.io/xportr/dev/reference/xpt_validate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate Dataset Can be Written to xpt — xpt_validate","text":"Returns character vector failed conditions","code":""}]
Miller E, Straub B, Zhu Z, Brockmann E, Viyash V, Verissimo A, Shapcott S, Piraux C, Zhang K, Chan A, Mascary S (2024). xportr: Utilities to Output CDISC SDTM/ADaM XPT Files. -R package version 0.3.1.9032, +R package version 0.3.1.9033, https://github.com/atorus-research/xportr, https://atorus-research.github.io/xportr/.
@Manual{, title = {xportr: Utilities to Output CDISC SDTM/ADaM XPT Files}, author = {Eli Miller and Ben Straub and Zelos Zhu and Ethan Brockmann and Vedha Viyash and Andre Verissimo and Sophie Shapcott and Celine Piraux and Kangjie Zhang and Adrian Chan and Sadchla Mascary}, year = {2024}, - note = {R package version 0.3.1.9032, + note = {R package version 0.3.1.9033, https://github.com/atorus-research/xportr}, url = {https://atorus-research.github.io/xportr/}, }
xportr_metadata() can set verbose for a whole pipeline, i.e. setting verbose in xportr_metadata() will populate to all xportr functions. (#151)
xportr_metadata()
verbose
xportr
All xportr functions now have verbose = NULL as the default (#151)
verbose = NULL
Bug fix for domain filtering (#137)
xportr()
xportr_split()
xportr_write()
metadata
xportr_*
xportr_df_label()
xpt_validate()
xportr_options()
xportr.character_metadata_types
xportr.numeric_metadata_types
xportr.character_types
xportr.numeric_types
xportr_length()
length_source
xportr_format()
Remove unused packages from Suggests (#221)
xportr_write() now accepts metadata argument which can be used to set the dataset label to stay consistent with the other xportr_* functions. It is noteworthy that the dataset label set using the xportr_df_label() function will be retained during the xportr_write().
Exporting a new dataset dataset_spec that contains the Dataset Specification for ADSL. (#179)
dataset_spec
Added a check for character variable lengths up to 200 bytes in xpt_validate()(#91, #189).
File name check is moved to strict_checks condition to allow underscores in the file name. Underscores are allowed in xpt but not per FDA requirements. (#126)
It is now possible to get and set the xportr options using the helper function xportr_options() (#130)
Added xportr.character_metadata_types and xportr.numeric_metadata_types to list the metadata types that are character or numeric. Updated xportr.character_types and xportr.numeric_types to list only the R types that are character and the R types that are numeric. This ensures that all R types, including dates, are now managed by xportr_type. If the R type differs from the metadata type, the variable is coerced (#161)..
Adds argument assertions to public functions using checkmate (#175)
xportr_split() is a new function that allows users to split a dataset into multiple output files based on a variable. (#183)
All xportr functions now have verbose = NULL as the default. If left NULL, the previous default of getOption("xportr.[fn_name]_verbose") is used (#151)
NULL
getOption("xportr.[fn_name]_verbose")
All core functions can be run together by using new function xportr() (#137)
New argument in xportr_length() allows selection between the length from metadata, as previously done, or from the calculated maximum length per variable when length_source is set to “data” (#91)
Series of basic checks added to the xportr_format() function to ensure format lengths, prefixes are accurate for the variable type. Also to ensure that any numeric date/datetime/time variables have a format. (#164)
Make xportr_type() drop factor levels when coercing variables
xportr_type()
xportr_length() assigns the maximum length value instead of 200 for a character variable when the length is missing in the metadata (#207)
The domain argument for xportr functions will no longer be dynamically determined by the name of the data frame passed as the .df argument. This was done to make the use of xportr functions more explicit. (#182)
domain
The label argument from the xportr_write() function is deprecated in favor of the metadata argument. (#179)
label
The metacore argument, which was renamed to metadata in the following six xportr functions: (xportr_df_label(), xportr_format(), xportr_label(), xportr_length(), xportr_order(), and xportr_type()) in version 0.3.0 with a soft deprecation warning, has now been hard deprecated. Please update your code to use the new metadata argument in place of metacore.
metacore
xportr_label()
xportr_order()
0.3.0
SASlength and SAStype were removed since they did not have an impact on xpt_validate or any other functions (#132)
SASlength
SAStype
xpt_validate
Removes admiral from suggested dependencies (#237)
admiral
adsl data object is now called adsl_xportr (#237)
adsl
adsl_xportr
Data objects are no longer lazy loaded, which means that when needed the user must call data("name_of_object") first (#237)
data("name_of_object")
.df
Created development version of the website (#187)
Additional guidance for options added in deep dive vignette (#81)
Added a vignette about standards in different agencies (#206)
Removed non-user facing function documentation (#192)
Added more details about xportr_length() and xportr() to deep dive vignette (#215, #222)