-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from atorus-research/order_fix
fix order variable. Closes #8
- Loading branch information
Showing
13 changed files
with
95 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ | |
^xportr.*\.tar\.gz$ | ||
^xportr.*\.tgz$ | ||
^dev$ | ||
^advs\.xpt$ | ||
^advs_Define-Excel-Spec_match_admiral\.xlsx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
suppressWarnings({ | ||
library(haven) | ||
library(readxl) | ||
}) | ||
|
||
test_that("Domain not in character format", { | ||
|
||
ADAE <- read_sas(system.file("extdata", "adae.sas7bdat", package = "xportr")) | ||
met <- read_excel(system.file("specs", "ADaM_spec.xlsx", package = "xportr"), 3) | ||
|
||
expect_error( | ||
xportr_length(ADAE, metacore = met, domain = ADAE, verbose = "none") | ||
) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# library(dplyr) | ||
suppressWarnings({ | ||
library(haven) | ||
library(readxl) | ||
}) | ||
|
||
# | ||
# #context("xportr_seq correctly order dataset according to spec") | ||
# | ||
|
||
test_that("Variable are ordered correctly", { | ||
|
||
ADAE <- read_sas(system.file("extdata", "adae.sas7bdat", package = "xportr")) | ||
met <- read_excel(system.file("specs", "ADaM_spec.xlsx", package = "xportr"), 3) | ||
|
||
withr::with_options( | ||
list(xportr.order_name = "Order", xportr.variable_name = "Variable"), { | ||
ADAE_xportr <- xportr_order(ADAE, metacore = met, "ADAE", verbose = "none") | ||
} | ||
) | ||
|
||
after_names <- c("STUDYID", "USUBJID", "AEDECOD", "AESOC", "AETERM", "AESER", | ||
"ASTDT", "AENDT", "ATOXGR", "TRT01A", "TRT01AN", "SAFFL", "SUBJID", | ||
"WEIGHTBL", "SEX", "AGE", "AGEU", "RACE", "SITEID", "RACEN", | ||
"ASTTM", "ADURC", "AEACN", "AEOUT", "AEREL", "ATOXGRN", "AFTRTSTC", | ||
"AEWDFL") | ||
|
||
expect_equal(names(ADAE_xportr), after_names) | ||
}) | ||
|
||
test_that("Domain not in character format", { | ||
|
||
ADAE <- read_sas(system.file("extdata", "adae.sas7bdat", package = "xportr")) | ||
met <- read_excel(system.file("specs", "ADaM_spec.xlsx", package = "xportr"), 3) | ||
|
||
expect_error( | ||
withr::with_options( | ||
list(xportr.order_name = "Order", xportr.variable_name = "Variable"), { | ||
ADAE_xportr <- xportr_order(ADAE, metacore = met, domain = ADAE, verbose = "none") | ||
} | ||
)) | ||
|
||
|
||
}) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters