From 8d549270e80fdd74eb011adcf6cdd9725bdecc08 Mon Sep 17 00:00:00 2001 From: statasaurus <55274484+statasaurus@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:15:42 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20pharmave?= =?UTF-8?q?rse/metatools@f3308c0c501b551e20c8515c1ae8e213b2b98117=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- news/index.html | 3 ++- pkgdown.yml | 2 +- search.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/news/index.html b/news/index.html index 322b8ad..3e71be6 100644 --- a/news/index.html +++ b/news/index.html @@ -46,7 +46,8 @@

metatools 0.1.5.9000

-

metatools 0.1.4

CRAN release: 2023-02-13

diff --git a/pkgdown.yml b/pkgdown.yml index 55077a3..0422d08 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.0.9 pkgdown_sha: ~ articles: {} -last_built: 2024-04-19T12:13Z +last_built: 2024-04-19T12:15Z urls: reference: https://pharmaverse.github.io/metatools/reference article: https://pharmaverse.github.io/metatools/articles diff --git a/search.json b/search.json index b74dfd8..65db302 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://pharmaverse.github.io/metatools/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2022 metatools authors 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://pharmaverse.github.io/metatools/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Christina Fillmore. Author, maintainer. Mike Stackhouse. Author. GlaxoSmithKline LLC. Copyright holder, funder. F. Hoffmann-La Roche AG. Copyright holder, funder. Atorus Research LLC. Copyright holder, funder.","code":""},{"path":"https://pharmaverse.github.io/metatools/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Fillmore C, Stackhouse M (2024). metatools: Enable Use 'metacore' Help Create Check Dataset. R package version 0.1.5.9000, https://pharmaverse.github.io/metatools/.","code":"@Manual{, title = {metatools: Enable the Use of 'metacore' to Help Create and Check Dataset}, author = {Christina Fillmore and Mike Stackhouse}, year = {2024}, note = {R package version 0.1.5.9000}, url = {https://pharmaverse.github.io/metatools/}, }"},{"path":"https://pharmaverse.github.io/metatools/index.html","id":"metatools-","dir":"","previous_headings":"","what":"Enable the Use of metacore to Help Create and Check Dataset","title":"Enable the Use of metacore to Help Create and Check Dataset","text":"goal metatools enable use metacore objects. Metatools can used build datasets enhance columns existing datasets well checking datasets metadata metacore.","code":""},{"path":"https://pharmaverse.github.io/metatools/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Enable the Use of metacore to Help Create and Check Dataset","text":"can install latest released version metatools CRAN : current development version GitHub :","code":"install.packages(\"metatools\") devtools::install_github(\"pharmaverse/metatools\")"},{"path":"https://pharmaverse.github.io/metatools/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Enable the Use of metacore to Help Create and Check Dataset","text":"basic example functions build datasets create new columns. Metatools can also used run checks","code":"library(metatools) library(metacore) library(haven) library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union load(metacore_example(\"pilot_ADaM.rda\")) metacore <- metacore %>% select_dataset(\"ADSL\") ds_list <- list(DM = read_xpt(metatools_example(\"dm.xpt\"))) # Pull in columns from DM to be in ADSL adsl <- build_from_derived(metacore, ds_list, predecessor_only = FALSE) adsl #> # A tibble: 306 × 13 #> STUDYID USUBJID SUBJID SITEID TRT01P AGE AGEU RACE SEX ETHNIC DTHFL #> #> 1 CDISCPILOT… 01-701… 1015 701 Place… 63 YEARS WHITE F HISPA… \"\" #> 2 CDISCPILOT… 01-701… 1023 701 Place… 64 YEARS WHITE M HISPA… \"\" #> 3 CDISCPILOT… 01-701… 1028 701 Xanom… 71 YEARS WHITE M NOT H… \"\" #> 4 CDISCPILOT… 01-701… 1033 701 Xanom… 74 YEARS WHITE M NOT H… \"\" #> 5 CDISCPILOT… 01-701… 1034 701 Xanom… 77 YEARS WHITE F NOT H… \"\" #> 6 CDISCPILOT… 01-701… 1047 701 Place… 85 YEARS WHITE F NOT H… \"\" #> 7 CDISCPILOT… 01-701… 1057 701 Scree… 59 YEARS WHITE F HISPA… \"\" #> 8 CDISCPILOT… 01-701… 1097 701 Xanom… 68 YEARS WHITE M NOT H… \"\" #> 9 CDISCPILOT… 01-701… 1111 701 Xanom… 81 YEARS WHITE F NOT H… \"\" #> 10 CDISCPILOT… 01-701… 1115 701 Xanom… 84 YEARS WHITE M NOT H… \"\" #> # … with 296 more rows, and 2 more variables: RFSTDTC , RFENDTC # Now we can make some new columns and converting columns into factors adsl %>% select(USUBJID, AGE, ETHNIC) %>% create_cat_var(metacore, AGE, AGEGR1, AGEGR1N) %>% #Add an AGEGR1 and AGEGR1N column convert_var_to_fct(metacore, ETHNIC) # Change ETHNIC to as factor #> # A tibble: 306 × 5 #> USUBJID AGE ETHNIC AGEGR1 AGEGR1N #> #> 1 01-701-1015 63 HISPANIC OR LATINO <65 1 #> 2 01-701-1023 64 HISPANIC OR LATINO <65 1 #> 3 01-701-1028 71 NOT HISPANIC OR LATINO 65-80 2 #> 4 01-701-1033 74 NOT HISPANIC OR LATINO 65-80 2 #> 5 01-701-1034 77 NOT HISPANIC OR LATINO 65-80 2 #> 6 01-701-1047 85 NOT HISPANIC OR LATINO >80 3 #> 7 01-701-1057 59 HISPANIC OR LATINO <65 1 #> 8 01-701-1097 68 NOT HISPANIC OR LATINO 65-80 2 #> 9 01-701-1111 81 NOT HISPANIC OR LATINO >80 3 #> 10 01-701-1115 84 NOT HISPANIC OR LATINO >80 3 #> # … with 296 more rows data <- read_xpt(metatools_example(\"adsl.xpt\")) # Checks can be run on a single column check_ct_col(data, metacore, TRT01PN) # Checks column only contains control terminology #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # … with 244 more rows, and 39 more variables: TRTSDT , TRTEDT , #> # TRTDURD , AVGDD , CUMDOSE , AGE , AGEGR1 , #> # AGEGR1N , AGEU , RACE , RACEN , SEX , #> # ETHNIC , SAFFL , ITTFL , EFFFL , COMP8FL , #> # COMP16FL , COMP24FL , DISCONFL , DSRAEFL , DTHFL , #> # BMIBL , BMIBLGR1 , HEIGHTBL , WEIGHTBL , EDUCLVL , #> # DISONSDT , DURDIS , DURDSGR1 , VISIT1DT , … # Or across all the columns check_ct_data(data, metacore) %>% # Checks control terminology for all columns check_variables(metacore) # Check all variables in the metadata are in the dataset and there aren't any extra columns #> No missing or extra variables #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # … with 244 more rows, and 39 more variables: TRTSDT , TRTEDT , #> # TRTDURD , AVGDD , CUMDOSE , AGE , AGEGR1 , #> # AGEGR1N , AGEU , RACE , RACEN , SEX , #> # ETHNIC , SAFFL , ITTFL , EFFFL , COMP8FL , #> # COMP16FL , COMP24FL , DISCONFL , DSRAEFL , DTHFL , #> # BMIBL , BMIBLGR1 , HEIGHTBL , WEIGHTBL , EDUCLVL , #> # DISONSDT , DURDIS , DURDSGR1 , VISIT1DT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply labels to multiple variables on a data frame — add_labels","title":"Apply labels to multiple variables on a data frame — add_labels","text":"function allows user apply several labels dataframe .","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply labels to multiple variables on a data frame — add_labels","text":"","code":"add_labels(data, ...)"},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply labels to multiple variables on a data frame — add_labels","text":"data data.frame tibble ... Named parameters form variable = 'label'","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply labels to multiple variables on a data frame — add_labels","text":"data variable labels applied","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Apply labels to multiple variables on a data frame — add_labels","text":"","code":"add_labels( mtcars, mpg = \"Miles Per Gallon\", cyl = \"Cylinders\" ) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Missing Variables — add_variables","title":"Add Missing Variables — add_variables","text":"function adds missing columns according type set metacore object. values new columns missing, typed correctly. unable recognize type metacore object return logical type.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Missing Variables — add_variables","text":"","code":"add_variables(dataset, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Missing Variables — add_variables","text":"dataset Dataset add columns . variables present columns added. metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Missing Variables — add_variables","text":"given dataset additional columns added","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Missing Variables — add_variables","text":"","code":"library(metacore) library(haven) library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) %>% select(-TRTSDT, -TRT01P, -TRT01PN) add_variables(data, spec) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01A TRT01AN TRTEDT TRTDURD #> #> 1 CDISCP… 01-701… 1015 701 701 Plac… Place… 0 2014-07-02 182 #> 2 CDISCP… 01-701… 1023 701 701 Plac… Place… 0 2012-09-01 28 #> 3 CDISCP… 01-701… 1028 701 701 Xano… Xanom… 81 2014-01-14 180 #> 4 CDISCP… 01-701… 1033 701 701 Xano… Xanom… 54 2014-03-31 14 #> 5 CDISCP… 01-701… 1034 701 701 Xano… Xanom… 81 2014-12-30 183 #> 6 CDISCP… 01-701… 1047 701 701 Plac… Place… 0 2013-03-09 26 #> 7 CDISCP… 01-701… 1097 701 701 Xano… Xanom… 54 2014-07-09 190 #> 8 CDISCP… 01-701… 1111 701 701 Xano… Xanom… 54 2012-09-16 10 #> 9 CDISCP… 01-701… 1115 701 701 Xano… Xanom… 54 2013-01-23 55 #> 10 CDISCP… 01-701… 1118 701 701 Plac… Place… 0 2014-09-09 182 #> # ℹ 244 more rows #> # ℹ 39 more variables: AVGDD , CUMDOSE , AGE , AGEGR1 , #> # AGEGR1N , AGEU , RACE , RACEN , SEX , #> # ETHNIC , SAFFL , ITTFL , EFFFL , COMP8FL , #> # COMP16FL , COMP24FL , DISCONFL , DSRAEFL , DTHFL , #> # BMIBL , BMIBLGR1 , HEIGHTBL , WEIGHTBL , EDUCLVL , #> # DISONSDT , DURDIS , DURDSGR1 , VISIT1DT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":null,"dir":"Reference","previous_headings":"","what":"Build a dataset from derived — build_from_derived","title":"Build a dataset from derived — build_from_derived","text":"function builds dataset columns just need pulled . variable derivation format 'dataset.variable' pulled create new dataset. multiple datasets present, joined shared `key_seq` variables. columns often called 'Predecessors' ADaM, universal optional specify.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build a dataset from derived — build_from_derived","text":"","code":"build_from_derived( metacore, ds_list, dataset_name = NULL, predecessor_only = TRUE, keep = FALSE )"},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build a dataset from derived — build_from_derived","text":"metacore metacore object contains specifications dataset interest. ds_list Named list datasets needed build dataset_name Optional string specify dataset built. needed metacore object provided already subsetted. predecessor_only default `FALSE`, `TRUE` use derivations origin 'Predecessor' keep Boolean determine original columns kept. default `FALSE`, ADaM columns kept. `TRUE` resulting dataset ADaM columns well SDTM column renamed ADaM (.e `ARM` `TRT01P` resulting dataset)","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build a dataset from derived — build_from_derived","text":"dataset","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Build a dataset from derived — build_from_derived","text":"","code":"library(metacore) library(haven) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") ds_list <- list(DM = read_xpt(metatools_example(\"dm.xpt\"))) build_from_derived(spec, ds_list, predecessor_only = FALSE) #> # A tibble: 306 × 13 #> STUDYID USUBJID SUBJID SITEID TRT01P AGE AGEU RACE SEX ETHNIC DTHFL #> #> 1 CDISCPILOT… 01-701… 1015 701 Place… 63 YEARS WHITE F HISPA… \"\" #> 2 CDISCPILOT… 01-701… 1023 701 Place… 64 YEARS WHITE M HISPA… \"\" #> 3 CDISCPILOT… 01-701… 1028 701 Xanom… 71 YEARS WHITE M NOT H… \"\" #> 4 CDISCPILOT… 01-701… 1033 701 Xanom… 74 YEARS WHITE M NOT H… \"\" #> 5 CDISCPILOT… 01-701… 1034 701 Xanom… 77 YEARS WHITE F NOT H… \"\" #> 6 CDISCPILOT… 01-701… 1047 701 Place… 85 YEARS WHITE F NOT H… \"\" #> 7 CDISCPILOT… 01-701… 1057 701 Scree… 59 YEARS WHITE F HISPA… \"\" #> 8 CDISCPILOT… 01-701… 1097 701 Xanom… 68 YEARS WHITE M NOT H… \"\" #> 9 CDISCPILOT… 01-701… 1111 701 Xanom… 81 YEARS WHITE F NOT H… \"\" #> 10 CDISCPILOT… 01-701… 1115 701 Xanom… 84 YEARS WHITE M NOT H… \"\" #> # ℹ 296 more rows #> # ℹ 2 more variables: RFSTDTC , RFENDTC "},{"path":"https://pharmaverse.github.io/metatools/reference/build_qnam.html","id":null,"dir":"Reference","previous_headings":"","what":"Build the observations for a single QNAM — build_qnam","title":"Build the observations for a single QNAM — build_qnam","text":"Build observations single QNAM","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_qnam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build the observations for a single QNAM — build_qnam","text":"","code":"build_qnam(dataset, qnam, qlabel, idvar, qeval, qorig)"},{"path":"https://pharmaverse.github.io/metatools/reference/build_qnam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build the observations for a single QNAM — build_qnam","text":"dataset Input dataset qnam QNAM value qlabel QLABEL value idvar IDVAR variable name (provided string) qeval QEVAL value populated QNAM qorig QORIG value populated QNAM","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_qnam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build the observations for a single QNAM — build_qnam","text":"Observations structured SUPP format","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Control Terminology for a Single Column — check_ct_col","title":"Check Control Terminology for a Single Column — check_ct_col","text":"function checks column dataset contains control terminology defined metacore specification","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Control Terminology for a Single Column — check_ct_col","text":"","code":"check_ct_col(data, metacore, var, na_acceptable = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Control Terminology for a Single Column — check_ct_col","text":"data Data check metacore metacore object get codelist . variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. var Name variable check na_acceptable Logical value, set `NULL` default, acceptability missing values based core variable \"Required\" `metacore` object. set `TRUE` pass check values control terminology missing. set `FALSE`NA acceptable.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Control Terminology for a Single Column — check_ct_col","text":"Given data column contains control terms. , error given values column","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Control Terminology for a Single Column — check_ct_col","text":"","code":"library(metacore) library(haven) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) check_ct_col(data, spec, TRT01PN) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , … check_ct_col(data, spec, \"TRT01PN\") #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Control Terminology for a Dataset — check_ct_data","title":"Check Control Terminology for a Dataset — check_ct_data","text":"function checks columns dataset contains control terminology defined metacore specification","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Control Terminology for a Dataset — check_ct_data","text":"","code":"check_ct_data(data, metacore, na_acceptable = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Control Terminology for a Dataset — check_ct_data","text":"data Dataset check metacore metacore object contains specifications dataset interest. variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. na_acceptable Logical value, set `NULL` default, acceptability missing values based core variable \"Required\" `metacore` object. set `TRUE` pass check values control terminology missing. set `FALSE`NA acceptable.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Control Terminology for a Dataset — check_ct_data","text":"Given data columns pass. error otherwise","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Control Terminology for a Dataset — check_ct_data","text":"","code":"library(haven) library(metacore) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) check_ct_data(data, spec) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Variable Names — check_variables","title":"Check Variable Names — check_variables","text":"function checks variables dataset variables defined metacore specifications. everything matches function return `TRUE` message starting everything expected. additional missing variables error explain discrepancies","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Variable Names — check_variables","text":"","code":"check_variables(data, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Variable Names — check_variables","text":"data Dataset check metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Variable Names — check_variables","text":"message dataset matches specification dataset, error otherwise","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Variable Names — check_variables","text":"","code":"library(haven) library(metacore) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) check_variables(data, spec) #> No missing or extra variables #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine the Domain and Supplemental Qualifier — combine_supp","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"Combine Domain Supplemental Qualifier","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"","code":"combine_supp(dataset, supp)"},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"dataset Domain dataset supp Supplemental Qualifier dataset","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"dataset supp variables added ","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"","code":"library(safetyData) library(tibble) combine_supp(sdtm_ae, sdtm_suppae) %>% as_tibble() #> # A tibble: 1,191 × 36 #> STUDYID DOMAIN USUBJID AESEQ AESPID AETERM AELLT AELLTCD AEDECOD AEPTCD AEHLT #> #> 1 CDISCP… AE 01-701… 1 E07 APPLI… APPL… NA APPLIC… NA HLT_… #> 2 CDISCP… AE 01-701… 2 E08 APPLI… APPL… NA APPLIC… NA HLT_… #> 3 CDISCP… AE 01-701… 3 E06 DIARR… DIAR… NA DIARRH… NA HLT_… #> 4 CDISCP… AE 01-701… 3 E10 ATRIO… AV B… NA ATRIOV… NA HLT_… #> 5 CDISCP… AE 01-701… 1 E08 ERYTH… ERYT… NA ERYTHE… NA HLT_… #> 6 CDISCP… AE 01-701… 2 E09 ERYTH… LOCA… NA ERYTHE… NA HLT_… #> 7 CDISCP… AE 01-701… 4 E08 ERYTH… ERYT… NA ERYTHE… NA HLT_… #> 8 CDISCP… AE 01-701… 1 E04 APPLI… APPL… NA APPLIC… NA HLT_… #> 9 CDISCP… AE 01-701… 2 E05 APPLI… APPL… NA APPLIC… NA HLT_… #> 10 CDISCP… AE 01-701… 1 E08 APPLI… APPL… NA APPLIC… NA HLT_… #> # ℹ 1,181 more rows #> # ℹ 25 more variables: AEHLTCD , AEHLGT , AEHLGTCD , #> # AEBODSYS , AEBDSYCD , AESOC , AESOCCD , AESEV , #> # AESER , AEACN , AEREL , AEOUT , AESCAN , #> # AESCONG , AESDISAB , AESDTH , AESHOSP , AESLIFE , #> # AESOD , AEDTC , AESTDTC , AEENDTC , AESTDY , #> # AEENDY , AETRTEM "},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"functions takes dataset, metacore object variable name. looks metacore object control terms given variable uses convert variable factor levels. control terminology code list, code column used. function fails control terminology external library","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"","code":"convert_var_to_fct(data, metacore, var)"},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"data dataset containing variable modified metacore metacore object get codelist . variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package var Name variable change","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"Dataset variable changed factor","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"","code":"library(metacore) library(haven) library(dplyr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") dm <- read_xpt(metatools_example(\"dm.xpt\")) %>% select(USUBJID, SEX, ARM) # Variable with codelist control terms convert_var_to_fct(dm, spec, SEX) #> # A tibble: 306 × 3 #> USUBJID SEX ARM #> #> 1 01-701-1015 F Placebo #> 2 01-701-1023 M Placebo #> 3 01-701-1028 M Xanomeline High Dose #> 4 01-701-1033 M Xanomeline Low Dose #> 5 01-701-1034 F Xanomeline High Dose #> 6 01-701-1047 F Placebo #> 7 01-701-1057 F Screen Failure #> 8 01-701-1097 M Xanomeline Low Dose #> 9 01-701-1111 F Xanomeline Low Dose #> 10 01-701-1115 M Xanomeline Low Dose #> # ℹ 296 more rows # Variable with permitted value control terms convert_var_to_fct(dm, spec, ARM) #> # A tibble: 306 × 3 #> USUBJID SEX ARM #> #> 1 01-701-1015 F Placebo #> 2 01-701-1023 M Placebo #> 3 01-701-1028 M Xanomeline High Dose #> 4 01-701-1033 M Xanomeline Low Dose #> 5 01-701-1034 F Xanomeline High Dose #> 6 01-701-1047 F Placebo #> 7 01-701-1057 F NA #> 8 01-701-1097 M Xanomeline Low Dose #> 9 01-701-1111 F Xanomeline Low Dose #> 10 01-701-1115 M Xanomeline Low Dose #> # ℹ 296 more rows"},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Categorical Variable from Codelist — create_cat_var","title":"Create Categorical Variable from Codelist — create_cat_var","text":"Using grouping either `decode_var` `code_var` reference variable (`ref_var`) create categorical variable numeric version categorical variable.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Categorical Variable from Codelist — create_cat_var","text":"","code":"create_cat_var(data, metacore, ref_var, grp_var, num_grp_var = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Categorical Variable from Codelist — create_cat_var","text":"data Dataset reference variable metacore metacore object get codelist . variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. ref_var Name variable used reference .e AGE creating AGEGR1 grp_var Name new grouped variable num_grp_var Name new numeric decode grouped variable. optional value given variable created","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Categorical Variable from Codelist — create_cat_var","text":"dataset new column added","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Categorical Variable from Codelist — create_cat_var","text":"","code":"library(metacore) library(haven) library(dplyr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") dm <- read_xpt(metatools_example(\"dm.xpt\")) %>% select(USUBJID, AGE) # Grouping Column Only create_cat_var(dm, spec, AGE, AGEGR1) #> # A tibble: 306 × 3 #> USUBJID AGE AGEGR1 #> #> 1 01-701-1015 63 <65 #> 2 01-701-1023 64 <65 #> 3 01-701-1028 71 65-80 #> 4 01-701-1033 74 65-80 #> 5 01-701-1034 77 65-80 #> 6 01-701-1047 85 >80 #> 7 01-701-1057 59 <65 #> 8 01-701-1097 68 65-80 #> 9 01-701-1111 81 >80 #> 10 01-701-1115 84 >80 #> # ℹ 296 more rows # Grouping Column and Numeric Decode create_cat_var(dm, spec, AGE, AGEGR1, AGEGR1N) #> # A tibble: 306 × 4 #> USUBJID AGE AGEGR1 AGEGR1N #> #> 1 01-701-1015 63 <65 1 #> 2 01-701-1023 64 <65 1 #> 3 01-701-1028 71 65-80 2 #> 4 01-701-1033 74 65-80 2 #> 5 01-701-1034 77 65-80 2 #> 6 01-701-1047 85 >80 3 #> 7 01-701-1057 59 <65 1 #> 8 01-701-1097 68 65-80 2 #> 9 01-701-1111 81 >80 3 #> 10 01-701-1115 84 >80 3 #> # ℹ 296 more rows"},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Subgroups — create_subgrps","title":"Create Subgroups — create_subgrps","text":"Create Subgroups","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Subgroups — create_subgrps","text":"","code":"create_subgrps(ref_vec, grp_defs)"},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Subgroups — create_subgrps","text":"ref_vec Vector numeric values grp_defs Vector strings groupings defined. Format must either: <00, >=00, 00-00, 00-<00","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Subgroups — create_subgrps","text":"Character vector values subgroups","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Subgroups — create_subgrps","text":"","code":"create_subgrps(c(1:10), c(\"<2\", \"2-5\", \">5\")) #> [1] \"<2\" \"2-5\" \"2-5\" \"2-5\" \"2-5\" \">5\" \">5\" \">5\" \">5\" \">5\" create_subgrps(c(1:10), c(\"<=2\", \">2-5\", \">5\")) #> [1] \"<=2\" \"<=2\" \">2-5\" \">2-5\" \">2-5\" \">5\" \">5\" \">5\" \">5\" \">5\" create_subgrps(c(1:10), c(\"<2\", \"2-<5\", \">=5\")) #> [1] \"<2\" \"2-<5\" \"2-<5\" \"2-<5\" \">=5\" \">=5\" \">=5\" \">=5\" \">=5\" \">=5\""},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Variable from Codelist — create_var_from_codelist","title":"Create Variable from Codelist — create_var_from_codelist","text":"functions uses code/decode pairs metacore object create new variables data","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Variable from Codelist — create_var_from_codelist","text":"","code":"create_var_from_codelist( data, metacore, input_var, out_var, decode_to_code = TRUE )"},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Variable from Codelist — create_var_from_codelist","text":"data Dataset contains input variable metacore metacore object get codelist . `out_var` different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. input_var Name variable translated new column out_var Name output variable. Note: grouping always code codelist associates `out_var` decode_to_code Direction translation. default assumes `input_var` decode column codelist. Set `FALSE` `input_var` code column codelist","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Variable from Codelist — create_var_from_codelist","text":"Dataset new column added","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Variable from Codelist — create_var_from_codelist","text":"","code":"library(metacore) library(tibble) data <- tribble( ~USUBJID, ~VAR1, ~VAR2, 1, \"M\", \"Male\", 2, \"F\", \"Female\", 3, \"F\", \"Female\", 4, \"U\", \"Unknown\", 5, \"M\", \"Male\", ) spec <- spec_to_metacore(metacore_example(\"p21_mock.xlsx\"), quiet = TRUE) #> #> Metadata successfully imported #> Loading in metacore object with suppressed warnings create_var_from_codelist(data, spec, VAR2, SEX) #> # A tibble: 5 × 4 #> USUBJID VAR1 VAR2 SEX #> #> 1 1 M Male M #> 2 2 F Female F #> 3 3 F Female F #> 4 4 U Unknown U #> 5 5 M Male M create_var_from_codelist(data, spec, \"VAR2\", \"SEX\") #> # A tibble: 5 × 4 #> USUBJID VAR1 VAR2 SEX #> #> 1 1 M Male M #> 2 2 F Female F #> 3 3 F Female F #> 4 4 U Unknown U #> 5 5 M Male M create_var_from_codelist(data, spec, VAR1, SEX, decode_to_code = FALSE) #> # A tibble: 5 × 4 #> USUBJID VAR1 VAR2 SEX #> #> 1 1 M Male Male #> 2 2 F Female Female #> 3 3 F Female Female #> 4 4 U Unknown Unknown #> 5 5 M Male Male"},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop Unspecified Variables — drop_unspec_vars","title":"Drop Unspecified Variables — drop_unspec_vars","text":"function drops unspecified variables. throw error dataset contain expected variables.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop Unspecified Variables — drop_unspec_vars","text":"","code":"drop_unspec_vars(dataset, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop Unspecified Variables — drop_unspec_vars","text":"dataset Dataset change metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop Unspecified Variables — drop_unspec_vars","text":"Dataset specified columns","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Drop Unspecified Variables — drop_unspec_vars","text":"","code":"library(metacore) library(haven) library(dplyr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) %>% select(USUBJID, SITEID) %>% mutate(foo = \"Hello\") drop_unspec_vars(data, spec) #> The following variable(s) were dropped: #> foo #> # A tibble: 254 × 2 #> USUBJID SITEID #> #> 1 01-701-1015 701 #> 2 01-701-1023 701 #> 3 01-701-1028 701 #> 4 01-701-1033 701 #> 5 01-701-1034 701 #> 6 01-701-1047 701 #> 7 01-701-1097 701 #> 8 01-701-1111 701 #> 9 01-701-1115 701 #> 10 01-701-1118 701 #> # ℹ 244 more rows"},{"path":"https://pharmaverse.github.io/metatools/reference/get_bad_ct.html","id":null,"dir":"Reference","previous_headings":"","what":"Gets vector of control terminology which should be there — get_bad_ct","title":"Gets vector of control terminology which should be there — get_bad_ct","text":"function checks column dataset contains control terminology defined metacore specification. return values found control terminology","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/get_bad_ct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gets vector of control terminology which should be there — get_bad_ct","text":"","code":"get_bad_ct(data, metacore, var, na_acceptable = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/get_bad_ct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gets vector of control terminology which should be there — get_bad_ct","text":"data Data check metacore metacore object get codelist . variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. var Name variable check na_acceptable Logical value, set `NULL` default, acceptability missing values based core variable \"Required\" `metacore` object. set `TRUE` pass check values control terminology missing. set `FALSE`NA acceptable.e","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/get_bad_ct.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gets vector of control terminology which should be there — get_bad_ct","text":"vector","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Supplemental Qualifier — make_supp_qual","title":"Make Supplemental Qualifier — make_supp_qual","text":"Make Supplemental Qualifier","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Supplemental Qualifier — make_supp_qual","text":"","code":"make_supp_qual(dataset, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Supplemental Qualifier — make_supp_qual","text":"dataset dataset supp pulled metacore subsetted metacore object get supp information . already subsetted `dataset_name` need provided dataset_name optional name dataset","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make Supplemental Qualifier — make_supp_qual","text":"CDISC formatted SUPP dataset","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Supplemental Qualifier — make_supp_qual","text":"","code":"library(metacore) library(safetyData) library(tibble) load(metacore_example(\"pilot_SDTM.rda\")) spec <- metacore %>% select_dataset(\"AE\") ae <- combine_supp(sdtm_ae, sdtm_suppae) make_supp_qual(ae, spec) %>% as_tibble() #> # A tibble: 1,191 × 10 #> STUDYID RDOMAIN USUBJID IDVAR IDVARVAL QNAM QLABEL QVAL QORIG QEVAL #> #> 1 CDISCPILOT01 AE 01-701-10… AESEQ 1 AETR… TREAT… Y DERI… CLIN… #> 2 CDISCPILOT01 AE 01-701-10… AESEQ 2 AETR… TREAT… Y DERI… CLIN… #> 3 CDISCPILOT01 AE 01-701-10… AESEQ 3 AETR… TREAT… Y DERI… CLIN… #> 4 CDISCPILOT01 AE 01-701-10… AESEQ 1 AETR… TREAT… Y DERI… CLIN… #> 5 CDISCPILOT01 AE 01-701-10… AESEQ 2 AETR… TREAT… Y DERI… CLIN… #> 6 CDISCPILOT01 AE 01-701-10… AESEQ 3 AETR… TREAT… Y DERI… CLIN… #> 7 CDISCPILOT01 AE 01-701-10… AESEQ 4 AETR… TREAT… Y DERI… CLIN… #> 8 CDISCPILOT01 AE 01-701-10… AESEQ 1 AETR… TREAT… Y DERI… CLIN… #> 9 CDISCPILOT01 AE 01-701-10… AESEQ 2 AETR… TREAT… Y DERI… CLIN… #> 10 CDISCPILOT01 AE 01-701-10… AESEQ 1 AETR… TREAT… Y DERI… CLIN… #> # ℹ 1,181 more rows"},{"path":"https://pharmaverse.github.io/metatools/reference/metatools_example.html","id":null,"dir":"Reference","previous_headings":"","what":"Get path to pkg example — metatools_example","title":"Get path to pkg example — metatools_example","text":"pkg comes bundled number sample files `inst/extdata` directory. function make easy access","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/metatools_example.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get path to pkg example — metatools_example","text":"","code":"metatools_example(file = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/metatools_example.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get path to pkg example — metatools_example","text":"file Name file. `NULL`, example files listed.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/metatools_example.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get path to pkg example — metatools_example","text":"","code":"metatools_example() #> [1] \"adsl.xpt\" \"dm.xpt\" metatools_example(\"dm.xpt\") #> [1] \"/home/runner/work/_temp/Library/metatools/extdata/dm.xpt\""},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":null,"dir":"Reference","previous_headings":"","what":"Sort Columns by Order — order_cols","title":"Sort Columns by Order — order_cols","text":"function sorts dataset according order found metacore object.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sort Columns by Order — order_cols","text":"","code":"order_cols(data, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sort Columns by Order — order_cols","text":"data Dataset sort metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sort Columns by Order — order_cols","text":"dataset ordered columns","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sort Columns by Order — order_cols","text":"","code":"library(metacore) library(haven) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) order_cols(data, spec) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://pharmaverse.github.io/metatools/reference/pipe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pipe operator — %>%","text":"lhs value magrittr placeholder. rhs function call using magrittr semantics.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"result calling `rhs(lhs)`.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove labels to multiple variables on a data frame — remove_labels","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"function allows user removes labels dataframe .","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"","code":"remove_labels(data)"},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"data data.frame tibble","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"data variable labels applied","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"","code":"library(haven) data <- read_xpt(metatools_example(\"adsl.xpt\")) remove_labels(data) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply labels to a data frame using a metacore object — set_variable_labels","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"function leverages metadata available metacore object apply labels data frame.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"","code":"set_variable_labels(data, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"data dataframe tibble upon labels applied metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"Dataframe labels applied","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"","code":"mc <- metacore::spec_to_metacore( metacore::metacore_example(\"p21_mock.xlsx\"), quiet=TRUE ) #> #> Metadata successfully imported #> Loading in metacore object with suppressed warnings dm <- haven::read_xpt(metatools_example(\"dm.xpt\")) set_variable_labels(dm, mc, dataset_name = \"DM\") #> # A tibble: 306 × 25 #> STUDYID DOMAIN USUBJID SUBJID RFSTDTC RFENDTC RFXSTDTC RFXENDTC RFICDTC #> #> 1 CDISCPILOT01 DM 01-701-… 1015 \"2014-… \"2014-… \"2014-0… \"2014-0… \"\" #> 2 CDISCPILOT01 DM 01-701-… 1023 \"2012-… \"2012-… \"2012-0… \"2012-0… \"\" #> 3 CDISCPILOT01 DM 01-701-… 1028 \"2013-… \"2014-… \"2013-0… \"2014-0… \"\" #> 4 CDISCPILOT01 DM 01-701-… 1033 \"2014-… \"2014-… \"2014-0… \"2014-0… \"\" #> 5 CDISCPILOT01 DM 01-701-… 1034 \"2014-… \"2014-… \"2014-0… \"2014-1… \"\" #> 6 CDISCPILOT01 DM 01-701-… 1047 \"2013-… \"2013-… \"2013-0… \"2013-0… \"\" #> 7 CDISCPILOT01 DM 01-701-… 1057 \"\" \"\" \"\" \"\" \"\" #> 8 CDISCPILOT01 DM 01-701-… 1097 \"2014-… \"2014-… \"2014-0… \"2014-0… \"\" #> 9 CDISCPILOT01 DM 01-701-… 1111 \"2012-… \"2012-… \"2012-0… \"2012-0… \"\" #> 10 CDISCPILOT01 DM 01-701-… 1115 \"2012-… \"2013-… \"2012-1… \"2013-0… \"\" #> # ℹ 296 more rows #> # ℹ 16 more variables: RFPENDTC , DTHDTC , DTHFL , SITEID , #> # AGE , AGEU , SEX , RACE , ETHNIC , ARMCD , #> # ARM , ACTARMCD , ACTARM , COUNTRY , DMDTC , #> # DMDY "},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Sort Rows by Key Sequence — sort_by_key","title":"Sort Rows by Key Sequence — sort_by_key","text":"function sorts dataset according key sequence found metacore object.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sort Rows by Key Sequence — sort_by_key","text":"","code":"sort_by_key(data, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sort Rows by Key Sequence — sort_by_key","text":"data Dataset sort metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sort Rows by Key Sequence — sort_by_key","text":"dataset ordered columns","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sort Rows by Key Sequence — sort_by_key","text":"","code":"library(metacore) library(haven) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) sort_by_key(data, spec) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-0159000","dir":"Changelog","previous_headings":"","what":"metatools 0.1.5.9000","title":"metatools 0.1.5.9000","text":"Allow supp data zero-row combine_supp() (fix #45)","code":""},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-014","dir":"Changelog","previous_headings":"","what":"metatools 0.1.4","title":"metatools 0.1.4","text":"CRAN release: 2023-02-13 correct bug combine_supp() data supp white space. Now trimmed attempting merge Updates made work newest version dplyr","code":""},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-013","dir":"Changelog","previous_headings":"","what":"metatools 0.1.3","title":"metatools 0.1.3","text":"CRAN release: 2022-10-06 correct bug build_from_derived() prevented multiple combined removed library calls tests remove floating_pt_correction combine_supp() best never change type main dataset Add message drop_unspec_vars explain variables dropped Correct bug order_cols, still work columns present","code":""},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-012","dir":"Changelog","previous_headings":"","what":"metatools 0.1.2","title":"metatools 0.1.2","text":"correct bug combine_supp() data supp different classes IDVARVAL add error combine_supp() report rows supp merged add floating_pt_correction argument combine_supp() used floating point errors IDVARVAL","code":""},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-011","dir":"Changelog","previous_headings":"","what":"metatools 0.1.1","title":"metatools 0.1.1","text":"CRAN release: 2022-04-20 Based tester feedback, remove row supplemental qualifiers empty rearranged columns","code":""}] +[{"path":"https://pharmaverse.github.io/metatools/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2022 metatools authors 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://pharmaverse.github.io/metatools/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Christina Fillmore. Author, maintainer. Mike Stackhouse. Author. GlaxoSmithKline LLC. Copyright holder, funder. F. Hoffmann-La Roche AG. Copyright holder, funder. Atorus Research LLC. Copyright holder, funder.","code":""},{"path":"https://pharmaverse.github.io/metatools/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Fillmore C, Stackhouse M (2024). metatools: Enable Use 'metacore' Help Create Check Dataset. R package version 0.1.5.9000, https://pharmaverse.github.io/metatools/.","code":"@Manual{, title = {metatools: Enable the Use of 'metacore' to Help Create and Check Dataset}, author = {Christina Fillmore and Mike Stackhouse}, year = {2024}, note = {R package version 0.1.5.9000}, url = {https://pharmaverse.github.io/metatools/}, }"},{"path":"https://pharmaverse.github.io/metatools/index.html","id":"metatools-","dir":"","previous_headings":"","what":"Enable the Use of metacore to Help Create and Check Dataset","title":"Enable the Use of metacore to Help Create and Check Dataset","text":"goal metatools enable use metacore objects. Metatools can used build datasets enhance columns existing datasets well checking datasets metadata metacore.","code":""},{"path":"https://pharmaverse.github.io/metatools/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Enable the Use of metacore to Help Create and Check Dataset","text":"can install latest released version metatools CRAN : current development version GitHub :","code":"install.packages(\"metatools\") devtools::install_github(\"pharmaverse/metatools\")"},{"path":"https://pharmaverse.github.io/metatools/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Enable the Use of metacore to Help Create and Check Dataset","text":"basic example functions build datasets create new columns. Metatools can also used run checks","code":"library(metatools) library(metacore) library(haven) library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union load(metacore_example(\"pilot_ADaM.rda\")) metacore <- metacore %>% select_dataset(\"ADSL\") ds_list <- list(DM = read_xpt(metatools_example(\"dm.xpt\"))) # Pull in columns from DM to be in ADSL adsl <- build_from_derived(metacore, ds_list, predecessor_only = FALSE) adsl #> # A tibble: 306 × 13 #> STUDYID USUBJID SUBJID SITEID TRT01P AGE AGEU RACE SEX ETHNIC DTHFL #> #> 1 CDISCPILOT… 01-701… 1015 701 Place… 63 YEARS WHITE F HISPA… \"\" #> 2 CDISCPILOT… 01-701… 1023 701 Place… 64 YEARS WHITE M HISPA… \"\" #> 3 CDISCPILOT… 01-701… 1028 701 Xanom… 71 YEARS WHITE M NOT H… \"\" #> 4 CDISCPILOT… 01-701… 1033 701 Xanom… 74 YEARS WHITE M NOT H… \"\" #> 5 CDISCPILOT… 01-701… 1034 701 Xanom… 77 YEARS WHITE F NOT H… \"\" #> 6 CDISCPILOT… 01-701… 1047 701 Place… 85 YEARS WHITE F NOT H… \"\" #> 7 CDISCPILOT… 01-701… 1057 701 Scree… 59 YEARS WHITE F HISPA… \"\" #> 8 CDISCPILOT… 01-701… 1097 701 Xanom… 68 YEARS WHITE M NOT H… \"\" #> 9 CDISCPILOT… 01-701… 1111 701 Xanom… 81 YEARS WHITE F NOT H… \"\" #> 10 CDISCPILOT… 01-701… 1115 701 Xanom… 84 YEARS WHITE M NOT H… \"\" #> # … with 296 more rows, and 2 more variables: RFSTDTC , RFENDTC # Now we can make some new columns and converting columns into factors adsl %>% select(USUBJID, AGE, ETHNIC) %>% create_cat_var(metacore, AGE, AGEGR1, AGEGR1N) %>% #Add an AGEGR1 and AGEGR1N column convert_var_to_fct(metacore, ETHNIC) # Change ETHNIC to as factor #> # A tibble: 306 × 5 #> USUBJID AGE ETHNIC AGEGR1 AGEGR1N #> #> 1 01-701-1015 63 HISPANIC OR LATINO <65 1 #> 2 01-701-1023 64 HISPANIC OR LATINO <65 1 #> 3 01-701-1028 71 NOT HISPANIC OR LATINO 65-80 2 #> 4 01-701-1033 74 NOT HISPANIC OR LATINO 65-80 2 #> 5 01-701-1034 77 NOT HISPANIC OR LATINO 65-80 2 #> 6 01-701-1047 85 NOT HISPANIC OR LATINO >80 3 #> 7 01-701-1057 59 HISPANIC OR LATINO <65 1 #> 8 01-701-1097 68 NOT HISPANIC OR LATINO 65-80 2 #> 9 01-701-1111 81 NOT HISPANIC OR LATINO >80 3 #> 10 01-701-1115 84 NOT HISPANIC OR LATINO >80 3 #> # … with 296 more rows data <- read_xpt(metatools_example(\"adsl.xpt\")) # Checks can be run on a single column check_ct_col(data, metacore, TRT01PN) # Checks column only contains control terminology #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # … with 244 more rows, and 39 more variables: TRTSDT , TRTEDT , #> # TRTDURD , AVGDD , CUMDOSE , AGE , AGEGR1 , #> # AGEGR1N , AGEU , RACE , RACEN , SEX , #> # ETHNIC , SAFFL , ITTFL , EFFFL , COMP8FL , #> # COMP16FL , COMP24FL , DISCONFL , DSRAEFL , DTHFL , #> # BMIBL , BMIBLGR1 , HEIGHTBL , WEIGHTBL , EDUCLVL , #> # DISONSDT , DURDIS , DURDSGR1 , VISIT1DT , … # Or across all the columns check_ct_data(data, metacore) %>% # Checks control terminology for all columns check_variables(metacore) # Check all variables in the metadata are in the dataset and there aren't any extra columns #> No missing or extra variables #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # … with 244 more rows, and 39 more variables: TRTSDT , TRTEDT , #> # TRTDURD , AVGDD , CUMDOSE , AGE , AGEGR1 , #> # AGEGR1N , AGEU , RACE , RACEN , SEX , #> # ETHNIC , SAFFL , ITTFL , EFFFL , COMP8FL , #> # COMP16FL , COMP24FL , DISCONFL , DSRAEFL , DTHFL , #> # BMIBL , BMIBLGR1 , HEIGHTBL , WEIGHTBL , EDUCLVL , #> # DISONSDT , DURDIS , DURDSGR1 , VISIT1DT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply labels to multiple variables on a data frame — add_labels","title":"Apply labels to multiple variables on a data frame — add_labels","text":"function allows user apply several labels dataframe .","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply labels to multiple variables on a data frame — add_labels","text":"","code":"add_labels(data, ...)"},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply labels to multiple variables on a data frame — add_labels","text":"data data.frame tibble ... Named parameters form variable = 'label'","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply labels to multiple variables on a data frame — add_labels","text":"data variable labels applied","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Apply labels to multiple variables on a data frame — add_labels","text":"","code":"add_labels( mtcars, mpg = \"Miles Per Gallon\", cyl = \"Cylinders\" ) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Missing Variables — add_variables","title":"Add Missing Variables — add_variables","text":"function adds missing columns according type set metacore object. values new columns missing, typed correctly. unable recognize type metacore object return logical type.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Missing Variables — add_variables","text":"","code":"add_variables(dataset, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Missing Variables — add_variables","text":"dataset Dataset add columns . variables present columns added. metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Missing Variables — add_variables","text":"given dataset additional columns added","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/add_variables.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Missing Variables — add_variables","text":"","code":"library(metacore) library(haven) library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) %>% select(-TRTSDT, -TRT01P, -TRT01PN) add_variables(data, spec) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01A TRT01AN TRTEDT TRTDURD #> #> 1 CDISCP… 01-701… 1015 701 701 Plac… Place… 0 2014-07-02 182 #> 2 CDISCP… 01-701… 1023 701 701 Plac… Place… 0 2012-09-01 28 #> 3 CDISCP… 01-701… 1028 701 701 Xano… Xanom… 81 2014-01-14 180 #> 4 CDISCP… 01-701… 1033 701 701 Xano… Xanom… 54 2014-03-31 14 #> 5 CDISCP… 01-701… 1034 701 701 Xano… Xanom… 81 2014-12-30 183 #> 6 CDISCP… 01-701… 1047 701 701 Plac… Place… 0 2013-03-09 26 #> 7 CDISCP… 01-701… 1097 701 701 Xano… Xanom… 54 2014-07-09 190 #> 8 CDISCP… 01-701… 1111 701 701 Xano… Xanom… 54 2012-09-16 10 #> 9 CDISCP… 01-701… 1115 701 701 Xano… Xanom… 54 2013-01-23 55 #> 10 CDISCP… 01-701… 1118 701 701 Plac… Place… 0 2014-09-09 182 #> # ℹ 244 more rows #> # ℹ 39 more variables: AVGDD , CUMDOSE , AGE , AGEGR1 , #> # AGEGR1N , AGEU , RACE , RACEN , SEX , #> # ETHNIC , SAFFL , ITTFL , EFFFL , COMP8FL , #> # COMP16FL , COMP24FL , DISCONFL , DSRAEFL , DTHFL , #> # BMIBL , BMIBLGR1 , HEIGHTBL , WEIGHTBL , EDUCLVL , #> # DISONSDT , DURDIS , DURDSGR1 , VISIT1DT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":null,"dir":"Reference","previous_headings":"","what":"Build a dataset from derived — build_from_derived","title":"Build a dataset from derived — build_from_derived","text":"function builds dataset columns just need pulled . variable derivation format 'dataset.variable' pulled create new dataset. multiple datasets present, joined shared `key_seq` variables. columns often called 'Predecessors' ADaM, universal optional specify.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build a dataset from derived — build_from_derived","text":"","code":"build_from_derived( metacore, ds_list, dataset_name = NULL, predecessor_only = TRUE, keep = FALSE )"},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build a dataset from derived — build_from_derived","text":"metacore metacore object contains specifications dataset interest. ds_list Named list datasets needed build dataset_name Optional string specify dataset built. needed metacore object provided already subsetted. predecessor_only default `FALSE`, `TRUE` use derivations origin 'Predecessor' keep Boolean determine original columns kept. default `FALSE`, ADaM columns kept. `TRUE` resulting dataset ADaM columns well SDTM column renamed ADaM (.e `ARM` `TRT01P` resulting dataset)","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build a dataset from derived — build_from_derived","text":"dataset","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_from_derived.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Build a dataset from derived — build_from_derived","text":"","code":"library(metacore) library(haven) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") ds_list <- list(DM = read_xpt(metatools_example(\"dm.xpt\"))) build_from_derived(spec, ds_list, predecessor_only = FALSE) #> # A tibble: 306 × 13 #> STUDYID USUBJID SUBJID SITEID TRT01P AGE AGEU RACE SEX ETHNIC DTHFL #> #> 1 CDISCPILOT… 01-701… 1015 701 Place… 63 YEARS WHITE F HISPA… \"\" #> 2 CDISCPILOT… 01-701… 1023 701 Place… 64 YEARS WHITE M HISPA… \"\" #> 3 CDISCPILOT… 01-701… 1028 701 Xanom… 71 YEARS WHITE M NOT H… \"\" #> 4 CDISCPILOT… 01-701… 1033 701 Xanom… 74 YEARS WHITE M NOT H… \"\" #> 5 CDISCPILOT… 01-701… 1034 701 Xanom… 77 YEARS WHITE F NOT H… \"\" #> 6 CDISCPILOT… 01-701… 1047 701 Place… 85 YEARS WHITE F NOT H… \"\" #> 7 CDISCPILOT… 01-701… 1057 701 Scree… 59 YEARS WHITE F HISPA… \"\" #> 8 CDISCPILOT… 01-701… 1097 701 Xanom… 68 YEARS WHITE M NOT H… \"\" #> 9 CDISCPILOT… 01-701… 1111 701 Xanom… 81 YEARS WHITE F NOT H… \"\" #> 10 CDISCPILOT… 01-701… 1115 701 Xanom… 84 YEARS WHITE M NOT H… \"\" #> # ℹ 296 more rows #> # ℹ 2 more variables: RFSTDTC , RFENDTC "},{"path":"https://pharmaverse.github.io/metatools/reference/build_qnam.html","id":null,"dir":"Reference","previous_headings":"","what":"Build the observations for a single QNAM — build_qnam","title":"Build the observations for a single QNAM — build_qnam","text":"Build observations single QNAM","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_qnam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build the observations for a single QNAM — build_qnam","text":"","code":"build_qnam(dataset, qnam, qlabel, idvar, qeval, qorig)"},{"path":"https://pharmaverse.github.io/metatools/reference/build_qnam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build the observations for a single QNAM — build_qnam","text":"dataset Input dataset qnam QNAM value qlabel QLABEL value idvar IDVAR variable name (provided string) qeval QEVAL value populated QNAM qorig QORIG value populated QNAM","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/build_qnam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build the observations for a single QNAM — build_qnam","text":"Observations structured SUPP format","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Control Terminology for a Single Column — check_ct_col","title":"Check Control Terminology for a Single Column — check_ct_col","text":"function checks column dataset contains control terminology defined metacore specification","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Control Terminology for a Single Column — check_ct_col","text":"","code":"check_ct_col(data, metacore, var, na_acceptable = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Control Terminology for a Single Column — check_ct_col","text":"data Data check metacore metacore object get codelist . variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. var Name variable check na_acceptable Logical value, set `NULL` default, acceptability missing values based core variable \"Required\" `metacore` object. set `TRUE` pass check values control terminology missing. set `FALSE`NA acceptable.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Control Terminology for a Single Column — check_ct_col","text":"Given data column contains control terms. , error given values column","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_col.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Control Terminology for a Single Column — check_ct_col","text":"","code":"library(metacore) library(haven) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) check_ct_col(data, spec, TRT01PN) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , … check_ct_col(data, spec, \"TRT01PN\") #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Control Terminology for a Dataset — check_ct_data","title":"Check Control Terminology for a Dataset — check_ct_data","text":"function checks columns dataset contains control terminology defined metacore specification","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Control Terminology for a Dataset — check_ct_data","text":"","code":"check_ct_data(data, metacore, na_acceptable = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Control Terminology for a Dataset — check_ct_data","text":"data Dataset check metacore metacore object contains specifications dataset interest. variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. na_acceptable Logical value, set `NULL` default, acceptability missing values based core variable \"Required\" `metacore` object. set `TRUE` pass check values control terminology missing. set `FALSE`NA acceptable.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Control Terminology for a Dataset — check_ct_data","text":"Given data columns pass. error otherwise","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_ct_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Control Terminology for a Dataset — check_ct_data","text":"","code":"library(haven) library(metacore) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) check_ct_data(data, spec) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Variable Names — check_variables","title":"Check Variable Names — check_variables","text":"function checks variables dataset variables defined metacore specifications. everything matches function return `TRUE` message starting everything expected. additional missing variables error explain discrepancies","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Variable Names — check_variables","text":"","code":"check_variables(data, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Variable Names — check_variables","text":"data Dataset check metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Variable Names — check_variables","text":"message dataset matches specification dataset, error otherwise","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/check_variables.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Variable Names — check_variables","text":"","code":"library(haven) library(metacore) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) check_variables(data, spec) #> No missing or extra variables #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine the Domain and Supplemental Qualifier — combine_supp","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"Combine Domain Supplemental Qualifier","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"","code":"combine_supp(dataset, supp)"},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"dataset Domain dataset supp Supplemental Qualifier dataset","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"dataset supp variables added ","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/combine_supp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine the Domain and Supplemental Qualifier — combine_supp","text":"","code":"library(safetyData) library(tibble) combine_supp(sdtm_ae, sdtm_suppae) %>% as_tibble() #> # A tibble: 1,191 × 36 #> STUDYID DOMAIN USUBJID AESEQ AESPID AETERM AELLT AELLTCD AEDECOD AEPTCD AEHLT #> #> 1 CDISCP… AE 01-701… 1 E07 APPLI… APPL… NA APPLIC… NA HLT_… #> 2 CDISCP… AE 01-701… 2 E08 APPLI… APPL… NA APPLIC… NA HLT_… #> 3 CDISCP… AE 01-701… 3 E06 DIARR… DIAR… NA DIARRH… NA HLT_… #> 4 CDISCP… AE 01-701… 3 E10 ATRIO… AV B… NA ATRIOV… NA HLT_… #> 5 CDISCP… AE 01-701… 1 E08 ERYTH… ERYT… NA ERYTHE… NA HLT_… #> 6 CDISCP… AE 01-701… 2 E09 ERYTH… LOCA… NA ERYTHE… NA HLT_… #> 7 CDISCP… AE 01-701… 4 E08 ERYTH… ERYT… NA ERYTHE… NA HLT_… #> 8 CDISCP… AE 01-701… 1 E04 APPLI… APPL… NA APPLIC… NA HLT_… #> 9 CDISCP… AE 01-701… 2 E05 APPLI… APPL… NA APPLIC… NA HLT_… #> 10 CDISCP… AE 01-701… 1 E08 APPLI… APPL… NA APPLIC… NA HLT_… #> # ℹ 1,181 more rows #> # ℹ 25 more variables: AEHLTCD , AEHLGT , AEHLGTCD , #> # AEBODSYS , AEBDSYCD , AESOC , AESOCCD , AESEV , #> # AESER , AEACN , AEREL , AEOUT , AESCAN , #> # AESCONG , AESDISAB , AESDTH , AESHOSP , AESLIFE , #> # AESOD , AEDTC , AESTDTC , AEENDTC , AESTDY , #> # AEENDY , AETRTEM "},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"functions takes dataset, metacore object variable name. looks metacore object control terms given variable uses convert variable factor levels. control terminology code list, code column used. function fails control terminology external library","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"","code":"convert_var_to_fct(data, metacore, var)"},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"data dataset containing variable modified metacore metacore object get codelist . variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package var Name variable change","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"Dataset variable changed factor","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/convert_var_to_fct.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Variable to Factor with Levels Set by Control Terms — convert_var_to_fct","text":"","code":"library(metacore) library(haven) library(dplyr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") dm <- read_xpt(metatools_example(\"dm.xpt\")) %>% select(USUBJID, SEX, ARM) # Variable with codelist control terms convert_var_to_fct(dm, spec, SEX) #> # A tibble: 306 × 3 #> USUBJID SEX ARM #> #> 1 01-701-1015 F Placebo #> 2 01-701-1023 M Placebo #> 3 01-701-1028 M Xanomeline High Dose #> 4 01-701-1033 M Xanomeline Low Dose #> 5 01-701-1034 F Xanomeline High Dose #> 6 01-701-1047 F Placebo #> 7 01-701-1057 F Screen Failure #> 8 01-701-1097 M Xanomeline Low Dose #> 9 01-701-1111 F Xanomeline Low Dose #> 10 01-701-1115 M Xanomeline Low Dose #> # ℹ 296 more rows # Variable with permitted value control terms convert_var_to_fct(dm, spec, ARM) #> # A tibble: 306 × 3 #> USUBJID SEX ARM #> #> 1 01-701-1015 F Placebo #> 2 01-701-1023 M Placebo #> 3 01-701-1028 M Xanomeline High Dose #> 4 01-701-1033 M Xanomeline Low Dose #> 5 01-701-1034 F Xanomeline High Dose #> 6 01-701-1047 F Placebo #> 7 01-701-1057 F NA #> 8 01-701-1097 M Xanomeline Low Dose #> 9 01-701-1111 F Xanomeline Low Dose #> 10 01-701-1115 M Xanomeline Low Dose #> # ℹ 296 more rows"},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Categorical Variable from Codelist — create_cat_var","title":"Create Categorical Variable from Codelist — create_cat_var","text":"Using grouping either `decode_var` `code_var` reference variable (`ref_var`) create categorical variable numeric version categorical variable.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Categorical Variable from Codelist — create_cat_var","text":"","code":"create_cat_var(data, metacore, ref_var, grp_var, num_grp_var = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Categorical Variable from Codelist — create_cat_var","text":"data Dataset reference variable metacore metacore object get codelist . variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. ref_var Name variable used reference .e AGE creating AGEGR1 grp_var Name new grouped variable num_grp_var Name new numeric decode grouped variable. optional value given variable created","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Categorical Variable from Codelist — create_cat_var","text":"dataset new column added","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_cat_var.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Categorical Variable from Codelist — create_cat_var","text":"","code":"library(metacore) library(haven) library(dplyr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") dm <- read_xpt(metatools_example(\"dm.xpt\")) %>% select(USUBJID, AGE) # Grouping Column Only create_cat_var(dm, spec, AGE, AGEGR1) #> # A tibble: 306 × 3 #> USUBJID AGE AGEGR1 #> #> 1 01-701-1015 63 <65 #> 2 01-701-1023 64 <65 #> 3 01-701-1028 71 65-80 #> 4 01-701-1033 74 65-80 #> 5 01-701-1034 77 65-80 #> 6 01-701-1047 85 >80 #> 7 01-701-1057 59 <65 #> 8 01-701-1097 68 65-80 #> 9 01-701-1111 81 >80 #> 10 01-701-1115 84 >80 #> # ℹ 296 more rows # Grouping Column and Numeric Decode create_cat_var(dm, spec, AGE, AGEGR1, AGEGR1N) #> # A tibble: 306 × 4 #> USUBJID AGE AGEGR1 AGEGR1N #> #> 1 01-701-1015 63 <65 1 #> 2 01-701-1023 64 <65 1 #> 3 01-701-1028 71 65-80 2 #> 4 01-701-1033 74 65-80 2 #> 5 01-701-1034 77 65-80 2 #> 6 01-701-1047 85 >80 3 #> 7 01-701-1057 59 <65 1 #> 8 01-701-1097 68 65-80 2 #> 9 01-701-1111 81 >80 3 #> 10 01-701-1115 84 >80 3 #> # ℹ 296 more rows"},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Subgroups — create_subgrps","title":"Create Subgroups — create_subgrps","text":"Create Subgroups","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Subgroups — create_subgrps","text":"","code":"create_subgrps(ref_vec, grp_defs)"},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Subgroups — create_subgrps","text":"ref_vec Vector numeric values grp_defs Vector strings groupings defined. Format must either: <00, >=00, 00-00, 00-<00","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Subgroups — create_subgrps","text":"Character vector values subgroups","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_subgrps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Subgroups — create_subgrps","text":"","code":"create_subgrps(c(1:10), c(\"<2\", \"2-5\", \">5\")) #> [1] \"<2\" \"2-5\" \"2-5\" \"2-5\" \"2-5\" \">5\" \">5\" \">5\" \">5\" \">5\" create_subgrps(c(1:10), c(\"<=2\", \">2-5\", \">5\")) #> [1] \"<=2\" \"<=2\" \">2-5\" \">2-5\" \">2-5\" \">5\" \">5\" \">5\" \">5\" \">5\" create_subgrps(c(1:10), c(\"<2\", \"2-<5\", \">=5\")) #> [1] \"<2\" \"2-<5\" \"2-<5\" \"2-<5\" \">=5\" \">=5\" \">=5\" \">=5\" \">=5\" \">=5\""},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Variable from Codelist — create_var_from_codelist","title":"Create Variable from Codelist — create_var_from_codelist","text":"functions uses code/decode pairs metacore object create new variables data","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Variable from Codelist — create_var_from_codelist","text":"","code":"create_var_from_codelist( data, metacore, input_var, out_var, decode_to_code = TRUE )"},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Variable from Codelist — create_var_from_codelist","text":"data Dataset contains input variable metacore metacore object get codelist . `out_var` different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. input_var Name variable translated new column out_var Name output variable. Note: grouping always code codelist associates `out_var` decode_to_code Direction translation. default assumes `input_var` decode column codelist. Set `FALSE` `input_var` code column codelist","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Variable from Codelist — create_var_from_codelist","text":"Dataset new column added","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/create_var_from_codelist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Variable from Codelist — create_var_from_codelist","text":"","code":"library(metacore) library(tibble) data <- tribble( ~USUBJID, ~VAR1, ~VAR2, 1, \"M\", \"Male\", 2, \"F\", \"Female\", 3, \"F\", \"Female\", 4, \"U\", \"Unknown\", 5, \"M\", \"Male\", ) spec <- spec_to_metacore(metacore_example(\"p21_mock.xlsx\"), quiet = TRUE) #> #> Metadata successfully imported #> Loading in metacore object with suppressed warnings create_var_from_codelist(data, spec, VAR2, SEX) #> # A tibble: 5 × 4 #> USUBJID VAR1 VAR2 SEX #> #> 1 1 M Male M #> 2 2 F Female F #> 3 3 F Female F #> 4 4 U Unknown U #> 5 5 M Male M create_var_from_codelist(data, spec, \"VAR2\", \"SEX\") #> # A tibble: 5 × 4 #> USUBJID VAR1 VAR2 SEX #> #> 1 1 M Male M #> 2 2 F Female F #> 3 3 F Female F #> 4 4 U Unknown U #> 5 5 M Male M create_var_from_codelist(data, spec, VAR1, SEX, decode_to_code = FALSE) #> # A tibble: 5 × 4 #> USUBJID VAR1 VAR2 SEX #> #> 1 1 M Male Male #> 2 2 F Female Female #> 3 3 F Female Female #> 4 4 U Unknown Unknown #> 5 5 M Male Male"},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop Unspecified Variables — drop_unspec_vars","title":"Drop Unspecified Variables — drop_unspec_vars","text":"function drops unspecified variables. throw error dataset contain expected variables.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop Unspecified Variables — drop_unspec_vars","text":"","code":"drop_unspec_vars(dataset, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop Unspecified Variables — drop_unspec_vars","text":"dataset Dataset change metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop Unspecified Variables — drop_unspec_vars","text":"Dataset specified columns","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/drop_unspec_vars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Drop Unspecified Variables — drop_unspec_vars","text":"","code":"library(metacore) library(haven) library(dplyr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) %>% select(USUBJID, SITEID) %>% mutate(foo = \"Hello\") drop_unspec_vars(data, spec) #> The following variable(s) were dropped: #> foo #> # A tibble: 254 × 2 #> USUBJID SITEID #> #> 1 01-701-1015 701 #> 2 01-701-1023 701 #> 3 01-701-1028 701 #> 4 01-701-1033 701 #> 5 01-701-1034 701 #> 6 01-701-1047 701 #> 7 01-701-1097 701 #> 8 01-701-1111 701 #> 9 01-701-1115 701 #> 10 01-701-1118 701 #> # ℹ 244 more rows"},{"path":"https://pharmaverse.github.io/metatools/reference/get_bad_ct.html","id":null,"dir":"Reference","previous_headings":"","what":"Gets vector of control terminology which should be there — get_bad_ct","title":"Gets vector of control terminology which should be there — get_bad_ct","text":"function checks column dataset contains control terminology defined metacore specification. return values found control terminology","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/get_bad_ct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gets vector of control terminology which should be there — get_bad_ct","text":"","code":"get_bad_ct(data, metacore, var, na_acceptable = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/get_bad_ct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gets vector of control terminology which should be there — get_bad_ct","text":"data Data check metacore metacore object get codelist . variable different codelists different datasets metacore object need subsetted using `select_dataset` metacore package. var Name variable check na_acceptable Logical value, set `NULL` default, acceptability missing values based core variable \"Required\" `metacore` object. set `TRUE` pass check values control terminology missing. set `FALSE`NA acceptable.e","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/get_bad_ct.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gets vector of control terminology which should be there — get_bad_ct","text":"vector","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Supplemental Qualifier — make_supp_qual","title":"Make Supplemental Qualifier — make_supp_qual","text":"Make Supplemental Qualifier","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Supplemental Qualifier — make_supp_qual","text":"","code":"make_supp_qual(dataset, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Supplemental Qualifier — make_supp_qual","text":"dataset dataset supp pulled metacore subsetted metacore object get supp information . already subsetted `dataset_name` need provided dataset_name optional name dataset","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make Supplemental Qualifier — make_supp_qual","text":"CDISC formatted SUPP dataset","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/make_supp_qual.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Supplemental Qualifier — make_supp_qual","text":"","code":"library(metacore) library(safetyData) library(tibble) load(metacore_example(\"pilot_SDTM.rda\")) spec <- metacore %>% select_dataset(\"AE\") ae <- combine_supp(sdtm_ae, sdtm_suppae) make_supp_qual(ae, spec) %>% as_tibble() #> # A tibble: 1,191 × 10 #> STUDYID RDOMAIN USUBJID IDVAR IDVARVAL QNAM QLABEL QVAL QORIG QEVAL #> #> 1 CDISCPILOT01 AE 01-701-10… AESEQ 1 AETR… TREAT… Y DERI… CLIN… #> 2 CDISCPILOT01 AE 01-701-10… AESEQ 2 AETR… TREAT… Y DERI… CLIN… #> 3 CDISCPILOT01 AE 01-701-10… AESEQ 3 AETR… TREAT… Y DERI… CLIN… #> 4 CDISCPILOT01 AE 01-701-10… AESEQ 1 AETR… TREAT… Y DERI… CLIN… #> 5 CDISCPILOT01 AE 01-701-10… AESEQ 2 AETR… TREAT… Y DERI… CLIN… #> 6 CDISCPILOT01 AE 01-701-10… AESEQ 3 AETR… TREAT… Y DERI… CLIN… #> 7 CDISCPILOT01 AE 01-701-10… AESEQ 4 AETR… TREAT… Y DERI… CLIN… #> 8 CDISCPILOT01 AE 01-701-10… AESEQ 1 AETR… TREAT… Y DERI… CLIN… #> 9 CDISCPILOT01 AE 01-701-10… AESEQ 2 AETR… TREAT… Y DERI… CLIN… #> 10 CDISCPILOT01 AE 01-701-10… AESEQ 1 AETR… TREAT… Y DERI… CLIN… #> # ℹ 1,181 more rows"},{"path":"https://pharmaverse.github.io/metatools/reference/metatools_example.html","id":null,"dir":"Reference","previous_headings":"","what":"Get path to pkg example — metatools_example","title":"Get path to pkg example — metatools_example","text":"pkg comes bundled number sample files `inst/extdata` directory. function make easy access","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/metatools_example.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get path to pkg example — metatools_example","text":"","code":"metatools_example(file = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/metatools_example.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get path to pkg example — metatools_example","text":"file Name file. `NULL`, example files listed.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/metatools_example.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get path to pkg example — metatools_example","text":"","code":"metatools_example() #> [1] \"adsl.xpt\" \"dm.xpt\" metatools_example(\"dm.xpt\") #> [1] \"/home/runner/work/_temp/Library/metatools/extdata/dm.xpt\""},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":null,"dir":"Reference","previous_headings":"","what":"Sort Columns by Order — order_cols","title":"Sort Columns by Order — order_cols","text":"function sorts dataset according order found metacore object.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sort Columns by Order — order_cols","text":"","code":"order_cols(data, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sort Columns by Order — order_cols","text":"data Dataset sort metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sort Columns by Order — order_cols","text":"dataset ordered columns","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/order_cols.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sort Columns by Order — order_cols","text":"","code":"library(metacore) library(haven) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) order_cols(data, spec) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://pharmaverse.github.io/metatools/reference/pipe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pipe operator — %>%","text":"lhs value magrittr placeholder. rhs function call using magrittr semantics.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"result calling `rhs(lhs)`.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove labels to multiple variables on a data frame — remove_labels","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"function allows user removes labels dataframe .","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"","code":"remove_labels(data)"},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"data data.frame tibble","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"data variable labels applied","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/remove_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove labels to multiple variables on a data frame — remove_labels","text":"","code":"library(haven) data <- read_xpt(metatools_example(\"adsl.xpt\")) remove_labels(data) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply labels to a data frame using a metacore object — set_variable_labels","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"function leverages metadata available metacore object apply labels data frame.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"","code":"set_variable_labels(data, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"data dataframe tibble upon labels applied metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"Dataframe labels applied","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/set_variable_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Apply labels to a data frame using a metacore object — set_variable_labels","text":"","code":"mc <- metacore::spec_to_metacore( metacore::metacore_example(\"p21_mock.xlsx\"), quiet=TRUE ) #> #> Metadata successfully imported #> Loading in metacore object with suppressed warnings dm <- haven::read_xpt(metatools_example(\"dm.xpt\")) set_variable_labels(dm, mc, dataset_name = \"DM\") #> # A tibble: 306 × 25 #> STUDYID DOMAIN USUBJID SUBJID RFSTDTC RFENDTC RFXSTDTC RFXENDTC RFICDTC #> #> 1 CDISCPILOT01 DM 01-701-… 1015 \"2014-… \"2014-… \"2014-0… \"2014-0… \"\" #> 2 CDISCPILOT01 DM 01-701-… 1023 \"2012-… \"2012-… \"2012-0… \"2012-0… \"\" #> 3 CDISCPILOT01 DM 01-701-… 1028 \"2013-… \"2014-… \"2013-0… \"2014-0… \"\" #> 4 CDISCPILOT01 DM 01-701-… 1033 \"2014-… \"2014-… \"2014-0… \"2014-0… \"\" #> 5 CDISCPILOT01 DM 01-701-… 1034 \"2014-… \"2014-… \"2014-0… \"2014-1… \"\" #> 6 CDISCPILOT01 DM 01-701-… 1047 \"2013-… \"2013-… \"2013-0… \"2013-0… \"\" #> 7 CDISCPILOT01 DM 01-701-… 1057 \"\" \"\" \"\" \"\" \"\" #> 8 CDISCPILOT01 DM 01-701-… 1097 \"2014-… \"2014-… \"2014-0… \"2014-0… \"\" #> 9 CDISCPILOT01 DM 01-701-… 1111 \"2012-… \"2012-… \"2012-0… \"2012-0… \"\" #> 10 CDISCPILOT01 DM 01-701-… 1115 \"2012-… \"2013-… \"2012-1… \"2013-0… \"\" #> # ℹ 296 more rows #> # ℹ 16 more variables: RFPENDTC , DTHDTC , DTHFL , SITEID , #> # AGE , AGEU , SEX , RACE , ETHNIC , ARMCD , #> # ARM , ACTARMCD , ACTARM , COUNTRY , DMDTC , #> # DMDY "},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Sort Rows by Key Sequence — sort_by_key","title":"Sort Rows by Key Sequence — sort_by_key","text":"function sorts dataset according key sequence found metacore object.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sort Rows by Key Sequence — sort_by_key","text":"","code":"sort_by_key(data, metacore, dataset_name = NULL)"},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sort Rows by Key Sequence — sort_by_key","text":"data Dataset sort metacore metacore object contains specifications dataset interest. dataset_name Optional string specify dataset. needed metacore object provided already subsetted.","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sort Rows by Key Sequence — sort_by_key","text":"dataset ordered columns","code":""},{"path":"https://pharmaverse.github.io/metatools/reference/sort_by_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sort Rows by Key Sequence — sort_by_key","text":"","code":"library(metacore) library(haven) library(magrittr) load(metacore_example(\"pilot_ADaM.rda\")) spec <- metacore %>% select_dataset(\"ADSL\") data <- read_xpt(metatools_example(\"adsl.xpt\")) sort_by_key(data, spec) #> # A tibble: 254 × 49 #> STUDYID USUBJID SUBJID SITEID SITEGR1 ARM TRT01P TRT01PN TRT01A TRT01AN #> #> 1 CDISCPILOT… 01-701… 1015 701 701 Plac… Place… 0 Place… 0 #> 2 CDISCPILOT… 01-701… 1023 701 701 Plac… Place… 0 Place… 0 #> 3 CDISCPILOT… 01-701… 1028 701 701 Xano… Xanom… 81 Xanom… 81 #> 4 CDISCPILOT… 01-701… 1033 701 701 Xano… Xanom… 54 Xanom… 54 #> 5 CDISCPILOT… 01-701… 1034 701 701 Xano… Xanom… 81 Xanom… 81 #> 6 CDISCPILOT… 01-701… 1047 701 701 Plac… Place… 0 Place… 0 #> 7 CDISCPILOT… 01-701… 1097 701 701 Xano… Xanom… 54 Xanom… 54 #> 8 CDISCPILOT… 01-701… 1111 701 701 Xano… Xanom… 54 Xanom… 54 #> 9 CDISCPILOT… 01-701… 1115 701 701 Xano… Xanom… 54 Xanom… 54 #> 10 CDISCPILOT… 01-701… 1118 701 701 Plac… Place… 0 Place… 0 #> # ℹ 244 more rows #> # ℹ 39 more variables: TRTSDT , TRTEDT , TRTDURD , #> # AVGDD , CUMDOSE , AGE , AGEGR1 , AGEGR1N , #> # AGEU , RACE , RACEN , SEX , ETHNIC , SAFFL , #> # ITTFL , EFFFL , COMP8FL , COMP16FL , COMP24FL , #> # DISCONFL , DSRAEFL , DTHFL , BMIBL , BMIBLGR1 , #> # HEIGHTBL , WEIGHTBL , EDUCLVL , DISONSDT , …"},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-0159000","dir":"Changelog","previous_headings":"","what":"metatools 0.1.5.9000","title":"metatools 0.1.5.9000","text":"Breaking change: combine_supp() requires QNAM columns source dataset (#64) Allow supp data zero-row combine_supp() (fix #45)","code":""},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-014","dir":"Changelog","previous_headings":"","what":"metatools 0.1.4","title":"metatools 0.1.4","text":"CRAN release: 2023-02-13 correct bug combine_supp() data supp white space. Now trimmed attempting merge Updates made work newest version dplyr","code":""},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-013","dir":"Changelog","previous_headings":"","what":"metatools 0.1.3","title":"metatools 0.1.3","text":"CRAN release: 2022-10-06 correct bug build_from_derived() prevented multiple combined removed library calls tests remove floating_pt_correction combine_supp() best never change type main dataset Add message drop_unspec_vars explain variables dropped Correct bug order_cols, still work columns present","code":""},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-012","dir":"Changelog","previous_headings":"","what":"metatools 0.1.2","title":"metatools 0.1.2","text":"correct bug combine_supp() data supp different classes IDVARVAL add error combine_supp() report rows supp merged add floating_pt_correction argument combine_supp() used floating point errors IDVARVAL","code":""},{"path":"https://pharmaverse.github.io/metatools/news/index.html","id":"metatools-011","dir":"Changelog","previous_headings":"","what":"metatools 0.1.1","title":"metatools 0.1.1","text":"CRAN release: 2022-04-20 Based tester feedback, remove row supplemental qualifiers empty rearranged columns","code":""}]