From c0f84b0506404edc08353aa6c3019c0abc5a85c2 Mon Sep 17 00:00:00 2001 From: "Chan, Adrian {MDBT~Mississauga}" Date: Wed, 31 May 2023 05:38:33 +0200 Subject: [PATCH 01/23] updated to account for DT, DTM, TM variables --- R/type.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/R/type.R b/R/type.R index fa07c3f5..6fdb3e33 100644 --- a/R/type.R +++ b/R/type.R @@ -39,6 +39,7 @@ xportr_type <- function(.df, metacore = NULL, domain = NULL, type_name <- getOption("xportr.type_name") characterTypes <- c(getOption("xportr.character_types"), "_character") numericTypes <- c(getOption("xportr.numeric_types"), "_numeric") + formats <- metacore[['var_spec']] ## Common section to detect domain from argument or pipes @@ -103,13 +104,18 @@ xportr_type <- function(.df, metacore = NULL, domain = NULL, function(x, i, is_correct) { if (!is_correct[i]) { orig_attributes <- attributes(.df[[i]]) - orig_attributes$class <- NULL if (correct_type[i] %in% characterTypes) { .df[[i]] <<- as.character(.df[[i]]) } else { - .df[[i]] <<- as.numeric(.df[[i]]) + .df[[i]] <<- as.numeric(.df[[i]]) } + + if (grepl('DT$|DTM$|TM$', colnames(df[i])) & + !is.na(formats[as.vector(formats$variable) == colnames(df[i]), 'format'][['format']])) { attributes(.df[[i]]) <<- orig_attributes + } else { + attributes(.df[[i]]) <- NULL + } } }, is_correct ) From 12fd07bf50db0a05c74a7fa04cc771a141d84b5b Mon Sep 17 00:00:00 2001 From: "Chan, Adrian {MDBT~Mississauga}" Date: Thu, 1 Jun 2023 19:07:41 +0200 Subject: [PATCH 02/23] updates --- R/type.R | 22 ++++++++++------------ tests/testthat/test-type.R | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/R/type.R b/R/type.R index 6fdb3e33..911259d2 100644 --- a/R/type.R +++ b/R/type.R @@ -39,7 +39,7 @@ xportr_type <- function(.df, metacore = NULL, domain = NULL, type_name <- getOption("xportr.type_name") characterTypes <- c(getOption("xportr.character_types"), "_character") numericTypes <- c(getOption("xportr.numeric_types"), "_numeric") - formats <- metacore[['var_spec']] + format_name <- getOption("xportr.format_name") ## Common section to detect domain from argument or pipes @@ -63,7 +63,7 @@ xportr_type <- function(.df, metacore = NULL, domain = NULL, filter(!!sym(domain_name) == domain) } metacore <- metacore %>% - select(!!sym(variable_name), !!sym(type_name)) + select(!!sym(variable_name), !!sym(type_name), !!sym(type_name), !!sym(format_name)) # Current class of table variables table_cols_types <- map(.df, first_class) @@ -105,16 +105,14 @@ xportr_type <- function(.df, metacore = NULL, domain = NULL, if (!is_correct[i]) { orig_attributes <- attributes(.df[[i]]) if (correct_type[i] %in% characterTypes) { - .df[[i]] <<- as.character(.df[[i]]) - } else { - .df[[i]] <<- as.numeric(.df[[i]]) - } - - if (grepl('DT$|DTM$|TM$', colnames(df[i])) & - !is.na(formats[as.vector(formats$variable) == colnames(df[i]), 'format'][['format']])) { - attributes(.df[[i]]) <<- orig_attributes - } else { - attributes(.df[[i]]) <- NULL + .df[[i]] <<- as.character(..df[[i]]) + attributes(.df[[i]]) <<- NULL + } else if (grepl('DT$|DTM$|TM$', colnames(.df[i])) & + !is.na(metacore[as.vector(metacore$variable) == colnames(.df[i]), 'format'][['format']])) { + attributes(.df[[i]]) <<- orig_attributes + } else { + .df[[i]] <<- as.numeric(.df[[i]]) + attributes(.df[[i]]) <<- NULL } } }, is_correct diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index 8db5e686..59f7492d 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -175,3 +175,23 @@ test_that("xportr_type: error when metadata is not set", { regexp = "Metadata must be set with `metacore` or `xportr_metadata\\(\\)`" ) }) + +test_that("xportr_type: date variables are not converted to numeric", { + df <- data.frame(RFICDT = as.Date('2017-03-30'), RFICDTM = as.POSIXct('2017-03-30')) + metacore_meta <- suppressWarnings( + metacore::metacore( + var_spec = data.frame( + variable = c("RFICDT", "RFICDTM"), + type = "integer", + label = c("RFICDT Label", "RFICDTM Label"), + length = c(1, 2), + common = NA_character_, + format = c("date9.", "datetime20.") + ) + ) + ) + processed_df <- xportr_type(df, metacore_meta) + expect_equal(lapply(df, class), lapply(processed_df, class)) + expect_equal(df$RFICDT, processed_df$RFICDT) + expect_equal(df$RFICDTM, processed_df$RFICDTM) +}) From 2f0e783ab24e53f7930af699b751a34f7b811fad Mon Sep 17 00:00:00 2001 From: "Chan, Adrian {MDBT~Mississauga}" Date: Thu, 1 Jun 2023 19:14:38 +0200 Subject: [PATCH 03/23] fixed --- R/type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/type.R b/R/type.R index 911259d2..20ead5ab 100644 --- a/R/type.R +++ b/R/type.R @@ -105,7 +105,7 @@ xportr_type <- function(.df, metacore = NULL, domain = NULL, if (!is_correct[i]) { orig_attributes <- attributes(.df[[i]]) if (correct_type[i] %in% characterTypes) { - .df[[i]] <<- as.character(..df[[i]]) + .df[[i]] <<- as.character(.df[[i]]) attributes(.df[[i]]) <<- NULL } else if (grepl('DT$|DTM$|TM$', colnames(.df[i])) & !is.na(metacore[as.vector(metacore$variable) == colnames(.df[i]), 'format'][['format']])) { From 713f3d3b98750c6aa2110470db955c97fe181c2d Mon Sep 17 00:00:00 2001 From: "Chan, Adrian {MDBT~Mississauga}" Date: Thu, 1 Jun 2023 19:16:53 +0200 Subject: [PATCH 04/23] fixed --- R/type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/type.R b/R/type.R index 20ead5ab..92acd91d 100644 --- a/R/type.R +++ b/R/type.R @@ -63,7 +63,7 @@ xportr_type <- function(.df, metacore = NULL, domain = NULL, filter(!!sym(domain_name) == domain) } metacore <- metacore %>% - select(!!sym(variable_name), !!sym(type_name), !!sym(type_name), !!sym(format_name)) + select(!!sym(variable_name), !!sym(type_name), !!sym(format_name)) # Current class of table variables table_cols_types <- map(.df, first_class) From 0fa5e682117128e6af917962c284cd6a16d6916b Mon Sep 17 00:00:00 2001 From: "Chan, Adrian {MDBT~Mississauga}" Date: Tue, 6 Jun 2023 22:47:33 +0200 Subject: [PATCH 05/23] updates --- R/type.R | 12 ++++-------- tests/testthat/test-type.R | 6 ++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/R/type.R b/R/type.R index 92acd91d..c4d886a8 100644 --- a/R/type.R +++ b/R/type.R @@ -78,7 +78,7 @@ xportr_type <- function(.df, metacore = NULL, domain = NULL, # _character is used here as a mask of character, in case someone doesn't # want 'character' coerced to character type.x = if_else(type.x %in% characterTypes, "_character", type.x), - type.x = if_else(type.x %in% numericTypes, "_numeric", type.x), + type.x = if_else(type.x %in% numericTypes | (grepl('DT$|DTM$|TM$', variable) & !is.na(format)), "_numeric", type.x), type.y = tolower(type.y), type.y = if_else(type.y %in% characterTypes, "_character", type.y), type.y = if_else(type.y %in% numericTypes, "_numeric", type.y) @@ -104,19 +104,15 @@ xportr_type <- function(.df, metacore = NULL, domain = NULL, function(x, i, is_correct) { if (!is_correct[i]) { orig_attributes <- attributes(.df[[i]]) + orig_attributes$class <- NULL if (correct_type[i] %in% characterTypes) { .df[[i]] <<- as.character(.df[[i]]) - attributes(.df[[i]]) <<- NULL - } else if (grepl('DT$|DTM$|TM$', colnames(.df[i])) & - !is.na(metacore[as.vector(metacore$variable) == colnames(.df[i]), 'format'][['format']])) { - attributes(.df[[i]]) <<- orig_attributes - } else { + } else { .df[[i]] <<- as.numeric(.df[[i]]) - attributes(.df[[i]]) <<- NULL } + attributes(.df[[i]]) <<- orig_attributes } }, is_correct ) - .df } diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index 59f7492d..527cf931 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -1,7 +1,8 @@ meta_example <- data.frame( dataset = "df", variable = c("Subj", "Param", "Val", "NotUsed"), - type = c("numeric", "character", "numeric", "character") + type = c("numeric", "character", "numeric", "character"), + format = NA ) df <- data.frame( @@ -23,7 +24,8 @@ test_that("xportr_type: NAs are handled as expected", { meta_example <- data.frame( dataset = "df", variable = c("Subj", "Param", "Val", "NotUsed"), - type = c("numeric", "character", "numeric", "character") + type = c("numeric", "character", "numeric", "character"), + format = NA ) df2 <- xportr_type(df, meta_example) From 3583b24651b50ccd0f0acc3e75bf0c130ee94348 Mon Sep 17 00:00:00 2001 From: "Chan, Adrian {MDBT~Mississauga}" Date: Thu, 8 Jun 2023 21:14:30 +0200 Subject: [PATCH 06/23] updates --- R/type.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/R/type.R b/R/type.R index 68795c86..704cfa92 100644 --- a/R/type.R +++ b/R/type.R @@ -76,7 +76,7 @@ xportr_type <- function( filter(!!sym(domain_name) == domain) } - metacore <- metacore %>% + metacore <- metadata %>% select(!!sym(variable_name), !!sym(type_name), !!sym(format_name)) # Current class of table variables @@ -93,8 +93,10 @@ xportr_type <- function( # want 'character' coerced to character type.x = if_else(type.x %in% characterTypes, "_character", type.x), type.x = if_else(type.x %in% numericTypes | (grepl('DT$|DTM$|TM$', variable) & !is.na(format)), "_numeric", type.x), + type.x = if_else(grepl('DTC$', variable) & type.x == '_character', 'Date', type.x), + type.y = if_else(is.na(type.y), type.x, type.y), type.y = tolower(type.y), - type.y = if_else(type.y %in% characterTypes, "_character", type.y), + type.y = if_else(type.y %in% characterTypes | (grepl('DTC$', variable) & is.na(format)), "_character", type.y), type.y = if_else(type.y %in% numericTypes, "_numeric", type.y) ) @@ -105,7 +107,6 @@ xportr_type <- function( type_mismatch_ind <- which(meta_ordered$type.x != meta_ordered$type.y) type_log(meta_ordered, type_mismatch_ind, verbose) - # Check if variable types match is_correct <- sapply(meta_ordered[["type.x"]] == meta_ordered[["type.y"]], isTRUE) # Use the original variable iff metadata is missing that variable From a772092bee84b06eef17c6973340a2e838118cec Mon Sep 17 00:00:00 2001 From: elimillera Date: Tue, 13 Jun 2023 14:50:45 +0000 Subject: [PATCH 07/23] Passing R CMD Check, linting, styling --- R/format.R | 11 +++++------ R/label.R | 11 +++++------ R/length.R | 11 +++++------ R/metadata.R | 1 + R/order.R | 11 +++++------ R/type.R | 23 +++++++++++++---------- R/xportr-package.R | 3 ++- man/xportr_metadata.Rd | 1 + man/xportr_type.Rd | 3 ++- tests/testthat/test-depreciation.R | 3 ++- tests/testthat/test-length.R | 2 +- tests/testthat/test-type.R | 2 +- 12 files changed, 43 insertions(+), 39 deletions(-) diff --git a/R/format.R b/R/format.R index 9c8fd527..bfc6bd40 100644 --- a/R/format.R +++ b/R/format.R @@ -28,12 +28,11 @@ #' ) #' #' adsl <- xportr_format(adsl, metadata) -xportr_format <- function( - .df, - metadata = NULL, - domain = NULL, - verbose = getOption("xportr.length_verbose", "none"), - metacore = deprecated()) { +xportr_format <- function(.df, + metadata = NULL, + domain = NULL, + verbose = getOption("xportr.length_verbose", "none"), + metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_warn( when = "0.3.0", diff --git a/R/label.R b/R/label.R index 738a5d50..e627c85c 100644 --- a/R/label.R +++ b/R/label.R @@ -30,12 +30,11 @@ #' ) #' #' adsl <- xportr_label(adsl, metadata) -xportr_label <- function( - .df, - metadata = NULL, - domain = NULL, - verbose = getOption("xportr.length_verbose", "none"), - metacore = deprecated()) { +xportr_label <- function(.df, + metadata = NULL, + domain = NULL, + verbose = getOption("xportr.length_verbose", "none"), + metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_warn( when = "0.3.0", diff --git a/R/length.R b/R/length.R index dd6842dd..46f6b26c 100644 --- a/R/length.R +++ b/R/length.R @@ -28,12 +28,11 @@ #' ) #' #' adsl <- xportr_length(adsl, metadata) -xportr_length <- function( - .df, - metadata = NULL, - domain = NULL, - verbose = getOption("xportr.length_verbose", "none"), - metacore = deprecated()) { +xportr_length <- function(.df, + metadata = NULL, + domain = NULL, + verbose = getOption("xportr.length_verbose", "none"), + metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_warn( when = "0.3.0", diff --git a/R/metadata.R b/R/metadata.R index 6c4f14c0..1dc9d603 100644 --- a/R/metadata.R +++ b/R/metadata.R @@ -21,6 +21,7 @@ #' dataset = "test", #' variable = c("Subj", "Param", "Val", "NotUsed"), #' type = c("numeric", "character", "numeric", "character"), +#' format = NA, #' order = c(1, 3, 4, 2) #' ) #' diff --git a/R/order.R b/R/order.R index a49a560f..769a24a1 100644 --- a/R/order.R +++ b/R/order.R @@ -25,12 +25,11 @@ #' ) #' #' adsl <- xportr_order(adsl, metadata) -xportr_order <- function( - .df, - metadata = NULL, - domain = NULL, - verbose = getOption("xportr.length_verbose", "none"), - metacore = deprecated()) { +xportr_order <- function(.df, + metadata = NULL, + domain = NULL, + verbose = getOption("xportr.length_verbose", "none"), + metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_warn( when = "0.3.0", diff --git a/R/type.R b/R/type.R index 704cfa92..02ceeb46 100644 --- a/R/type.R +++ b/R/type.R @@ -21,7 +21,8 @@ #' metadata <- data.frame( #' dataset = "test", #' variable = c("Subj", "Param", "Val", "NotUsed"), -#' type = c("numeric", "character", "numeric", "character") +#' type = c("numeric", "character", "numeric", "character"), +#' format = NA #' ) #' #' .df <- data.frame( @@ -32,12 +33,11 @@ #' ) #' #' df2 <- xportr_type(.df, metadata, "test") -xportr_type <- function( - .df, - metadata = NULL, - domain = NULL, - verbose = getOption("xportr.length_verbose", "none"), - metacore = deprecated()) { +xportr_type <- function(.df, + metadata = NULL, + domain = NULL, + verbose = getOption("xportr.length_verbose", "none"), + metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_warn( when = "0.3.0", @@ -92,11 +92,14 @@ xportr_type <- function( # _character is used here as a mask of character, in case someone doesn't # want 'character' coerced to character type.x = if_else(type.x %in% characterTypes, "_character", type.x), - type.x = if_else(type.x %in% numericTypes | (grepl('DT$|DTM$|TM$', variable) & !is.na(format)), "_numeric", type.x), - type.x = if_else(grepl('DTC$', variable) & type.x == '_character', 'Date', type.x), + type.x = if_else(type.x %in% numericTypes | (grepl("DT$|DTM$|TM$", variable) & !is.na(format)), + "_numeric", + type.x + ), + type.x = if_else(grepl("DTC$", variable) & type.x == "_character", "Date", type.x), type.y = if_else(is.na(type.y), type.x, type.y), type.y = tolower(type.y), - type.y = if_else(type.y %in% characterTypes | (grepl('DTC$', variable) & is.na(format)), "_character", type.y), + type.y = if_else(type.y %in% characterTypes | (grepl("DTC$", variable) & is.na(format)), "_character", type.y), type.y = if_else(type.y %in% numericTypes, "_numeric", type.y) ) diff --git a/R/xportr-package.R b/R/xportr-package.R index 8efbbf5b..c65382cd 100644 --- a/R/xportr-package.R +++ b/R/xportr-package.R @@ -26,7 +26,8 @@ globalVariables(c( "abbr_parsed", "abbr_stem", "adj_orig", "adj_parsed", "col_pos", "dict_varname", "lower_original_varname", "my_minlength", "num_st_ind", "original_varname", - "renamed_n", "renamed_var", "use_bundle", "viable_start", "type.x", "type.y" + "renamed_n", "renamed_var", "use_bundle", "viable_start", "type.x", "type.y", + "variable" )) # The following block is used by usethis to automatically manage diff --git a/man/xportr_metadata.Rd b/man/xportr_metadata.Rd index f92c62b1..ca3ce819 100644 --- a/man/xportr_metadata.Rd +++ b/man/xportr_metadata.Rd @@ -31,6 +31,7 @@ metadata <- data.frame( dataset = "test", variable = c("Subj", "Param", "Val", "NotUsed"), type = c("numeric", "character", "numeric", "character"), + format = NA, order = c(1, 3, 4, 2) ) diff --git a/man/xportr_type.Rd b/man/xportr_type.Rd index ce22475c..f6b99be0 100644 --- a/man/xportr_type.Rd +++ b/man/xportr_type.Rd @@ -39,7 +39,8 @@ columns_meta is a data.frame with names "Variables", "Type" metadata <- data.frame( dataset = "test", variable = c("Subj", "Param", "Val", "NotUsed"), - type = c("numeric", "character", "numeric", "character") + type = c("numeric", "character", "numeric", "character"), + format = NA ) .df <- data.frame( diff --git a/tests/testthat/test-depreciation.R b/tests/testthat/test-depreciation.R index e2167849..b3295295 100644 --- a/tests/testthat/test-depreciation.R +++ b/tests/testthat/test-depreciation.R @@ -92,7 +92,8 @@ test_that("xportr_type: deprecated metacore argument still works and gives warni df_meta <- data.frame( dataset = "df", variable = c("Subj", "Param", "Val", "NotUsed"), - type = c("numeric", "character", "numeric", "character") + type = c("numeric", "character", "numeric", "character"), + format = NA ) df2 <- xportr_type(df, metacore = df_meta) diff --git a/tests/testthat/test-length.R b/tests/testthat/test-length.R index db2316f1..1c13cbc4 100644 --- a/tests/testthat/test-length.R +++ b/tests/testthat/test-length.R @@ -45,7 +45,7 @@ test_that("xportr_length: Accepts valid domain names in metadata object", { test_that("xportr_length: CDISC data frame is being piped after another xportr function", { adsl <- minimal_table(30) metadata <- minimal_metadata( - dataset = TRUE, length = TRUE, type = TRUE, var_names = colnames(adsl) + dataset = TRUE, length = TRUE, type = TRUE, format = TRUE, var_names = colnames(adsl) ) # Setup temporary options with active verbose diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index 51cce8a6..e4ce9d1b 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -179,7 +179,7 @@ test_that("xportr_type: error when metadata is not set", { }) test_that("xportr_type: date variables are not converted to numeric", { - df <- data.frame(RFICDT = as.Date('2017-03-30'), RFICDTM = as.POSIXct('2017-03-30')) + df <- data.frame(RFICDT = as.Date("2017-03-30"), RFICDTM = as.POSIXct("2017-03-30")) metacore_meta <- suppressWarnings( metacore::metacore( var_spec = data.frame( From b9ea9e7dfae483300f56b2e92bb267217d2d761d Mon Sep 17 00:00:00 2001 From: "Chan, Adrian {MDBT~Mississauga}" Date: Wed, 14 Jun 2023 04:47:50 +0200 Subject: [PATCH 08/23] updated test --- inst/extdata/dfdates.xpt | Bin 0 -> 1120 bytes tests/testthat/dfdates.xpt | Bin 0 -> 1120 bytes tests/testthat/test-type.R | 8 ++++++++ 3 files changed, 8 insertions(+) create mode 100644 inst/extdata/dfdates.xpt create mode 100644 tests/testthat/dfdates.xpt diff --git a/inst/extdata/dfdates.xpt b/inst/extdata/dfdates.xpt new file mode 100644 index 0000000000000000000000000000000000000000..d52737bda37096f8bc2fb577a4fb9195aa2e41a7 GIT binary patch literal 1120 zcmd5*yApyh5DZp+#@SjhfRTbOkT~EN9{~$X9kj8;&*CHH2r4kB87sFSxg>YDyCkt- zTqsZ?+9*ENSS6ui>Hu+jZ=&IR1VGACK(xlH9Dr{-KCYjNoZ24FhT+oXe(lWyhX&LS z=Cgi0oMpb+(bVXbLWY$GW_n%!;ebn>UQSbwr;*xb%BYJPXe_~m07)KwQ_v>mR+*r?VO{JoTcoq z{o61pl3#kAhR`YiAOk|khz!&+3V3S%9}80io-VQp)@a1#VvmpJGSpn8F&XTgMpBd= lD=x1X)%AdB^RD|G`}z$w_6*-I-`z{L;q~t0#FWRUa}UI?vHk!6 literal 0 HcmV?d00001 diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index 51cce8a6..0942d280 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -196,4 +196,12 @@ test_that("xportr_type: date variables are not converted to numeric", { expect_equal(lapply(df, class), lapply(processed_df, class)) expect_equal(df$RFICDT, processed_df$RFICDT) expect_equal(df$RFICDTM, processed_df$RFICDTM) + + xportr_write(processed_df, file.path(system.file("extdata", package="xportr"), "dfdates.xpt")) + df_xpt <- read_xpt(file.path(system.file("extdata", package="xportr"), "dfdates.xpt")) + + expect_equal(lapply(df, class), lapply(df_xpt, class)) + expect_equal(df$RFICDT, df_xpt$RFICDT, ignore_attr = TRUE) + expect_equal(df$RFICDTM, df_xpt$RFICDTM, ignore_attr = TRUE) + }) From 839bffe2924347d3a42ec11909cfa359a807d517 Mon Sep 17 00:00:00 2001 From: "Chan, Adrian {MDBT~Mississauga}" Date: Wed, 14 Jun 2023 12:16:27 +0200 Subject: [PATCH 09/23] updates --- inst/extdata/dfdates.xpt | Bin 1120 -> 1120 bytes tests/testthat/test-type.R | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/extdata/dfdates.xpt b/inst/extdata/dfdates.xpt index d52737bda37096f8bc2fb577a4fb9195aa2e41a7..320011a419ce23f97b9c52f1af828b9f22d93691 100644 GIT binary patch delta 70 ucmaFB@qlB(3<*OcD??K&V*^7IuTVcDV=EYc;zs+4?_c7R-mK4L$OHi81{4hd delta 70 ucmaFB@qlB(3<(1hD-$y-Q)5FDuTVcDV=EYc;zs+4?_c7R-mK4L$OHiDauhWH diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index 38e57d53..ac253c87 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -202,6 +202,6 @@ test_that("xportr_type: date variables are not converted to numeric", { expect_equal(lapply(df, class), lapply(df_xpt, class)) expect_equal(df$RFICDT, df_xpt$RFICDT, ignore_attr = TRUE) - expect_equal(df$RFICDTM, df_xpt$RFICDTM, ignore_attr = TRUE) + expect_equal(as.character(df$RFICDTM), as.character(df_xpt$RFICDTM), ignore_attr = TRUE) }) From 00dcfe7a307dcf6a919549580c628ddff4a80619 Mon Sep 17 00:00:00 2001 From: "Chan, Adrian {MDBT~Mississauga}" Date: Wed, 14 Jun 2023 16:48:17 +0200 Subject: [PATCH 10/23] updates --- R/type.R | 2 +- inst/extdata/dfdates.xpt | Bin 1120 -> 1120 bytes inst/extdata/dfdates2.xpt | Bin 0 -> 1280 bytes tests/testthat/test-type.R | 26 +++++++++++++++++++++++++- 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 inst/extdata/dfdates2.xpt diff --git a/R/type.R b/R/type.R index 02ceeb46..ef52eac4 100644 --- a/R/type.R +++ b/R/type.R @@ -96,7 +96,7 @@ xportr_type <- function(.df, "_numeric", type.x ), - type.x = if_else(grepl("DTC$", variable) & type.x == "_character", "Date", type.x), + # type.x = if_else(grepl("DTC$", variable) & type.x == "_character", "Date", type.x), type.y = if_else(is.na(type.y), type.x, type.y), type.y = tolower(type.y), type.y = if_else(type.y %in% characterTypes | (grepl("DTC$", variable) & is.na(format)), "_character", type.y), diff --git a/inst/extdata/dfdates.xpt b/inst/extdata/dfdates.xpt index 320011a419ce23f97b9c52f1af828b9f22d93691..f35fabf9dfff9ef85ca9a9ffbc0d468d25fd70c0 100644 GIT binary patch delta 68 ucmaFB@qlB(OmQ)kODjVv`*4uvn(JYAPnf z!8o(;vCKvwF`SexFBXdk2BWdaMsPE;$MP2wG9QB_c(`Yy?|<8r_KtAY?Dewnosvrq TfPI_|g~8X~=Tav;qk~evSAD+T literal 0 HcmV?d00001 diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index ac253c87..f9525f7c 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -192,7 +192,7 @@ test_that("xportr_type: date variables are not converted to numeric", { ) ) ) - processed_df <- xportr_type(df, metacore_meta) + expect_message(processed_df <- xportr_type(df, metacore_meta), NA) expect_equal(lapply(df, class), lapply(processed_df, class)) expect_equal(df$RFICDT, processed_df$RFICDT) expect_equal(df$RFICDTM, processed_df$RFICDTM) @@ -204,4 +204,28 @@ test_that("xportr_type: date variables are not converted to numeric", { expect_equal(df$RFICDT, df_xpt$RFICDT, ignore_attr = TRUE) expect_equal(as.character(df$RFICDTM), as.character(df_xpt$RFICDTM), ignore_attr = TRUE) + metadata <- data.frame( + dataset = c("adsl", "adsl", "adsl", "adsl"), + variable = c("USUBJID", "DMDTC", "RFICDT", "RFICDTM"), + type = c("text", "date", "integer", "integer"), + format = c(NA, NA, "date9.", "datetime15.") + ) + + adsl_original <- tibble::tribble( + ~USUBJID, ~DMDTC, ~RFICDT, ~RFICDTM, + "test1", "2017-03-30", "2017-03-30", "2017-03-30", + "test2", "2017-01-08", "2017-01-08", "2017-01-08" + ) + + + adsl_original$RFICDT <- as.Date(adsl_original$RFICDT) + adsl_original$RFICDTM <- as.POSIXct(adsl_original$RFICDTM) + + expect_message(adsl_xpt2 <- adsl_original %>% + xportr_type(metadata), NA) + + attr(adsl_original, "_xportr.df_arg_") <- "adsl_original" + + expect_equal(adsl_original, adsl_xpt2) + }) From 0efc1b0e1e7b497764cc7a9c2c5ba75bc6fc6731 Mon Sep 17 00:00:00 2001 From: elimillera Date: Thu, 15 Jun 2023 13:14:53 +0000 Subject: [PATCH 11/23] clean up files, remove tibble dependancy on tests --- inst/extdata/dfdates.xpt | Bin 1120 -> 0 bytes inst/extdata/dfdates2.xpt | Bin 1280 -> 0 bytes tests/testthat/dfdates.xpt | Bin 1120 -> 0 bytes tests/testthat/test-type.R | 17 +++++++++-------- 4 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 inst/extdata/dfdates.xpt delete mode 100644 inst/extdata/dfdates2.xpt delete mode 100644 tests/testthat/dfdates.xpt diff --git a/inst/extdata/dfdates.xpt b/inst/extdata/dfdates.xpt deleted file mode 100644 index f35fabf9dfff9ef85ca9a9ffbc0d468d25fd70c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1120 zcmd5*yApyh5DZp+#@SjpfQSxVAaTGkpaBa@9kj93&*CHH2tHs?GgNLta!KxPcS%A{ z8J8e=kVrOGSVz93au4DA-blgx3V@WRfOs3rasckcbaDN7&7Fyjvu;?)kODjVv`*4uvn(JYAPnf z!8o(;vCKvwF`SexFBXdk2BWdaMsPE;$MP2wG9QB_c(`Yy?|<8r_KtAY?Dewnosvrq TfPI_|g~8X~=Tav;qk~evSAD+T diff --git a/tests/testthat/dfdates.xpt b/tests/testthat/dfdates.xpt deleted file mode 100644 index 6ff4612535dce5af545753329f80ddcfef90d326..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1120 zcmd5*u?~VT5Uoyr#<@Bez)B)pp*3KvXu-izgD#HvS$?D(MFoP|F!=`BYkPO^J=#z( zE)*yc#EMTe){(E6IzU+88*5l!0g$i+5Vf%=2jEUE7uQdDMyC$Wx?$7Re&ftMi+Z!U zM;Gn5JIj2vp{ddYJPXe_~m07)KwQ_v>mR+*r?VO{JoTcoq z{o61pl3#kAhR`YiAOk|khz!&+3V3S%9}80io-VQp)@a1#VvmpJGSpn8F&XTgMpBd= lD=x1X)%AdB^RD|G`}z$w_6*-I-`z{L;q~t0#FWRUa}UI?vHk!6 diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index b9a2388b..a3f1aacf 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -192,13 +192,13 @@ test_that("xportr_type: date variables are not converted to numeric", { ) ) ) - expect_message(processed_df <- xportr_type(df, metacore_meta), NA) + expect_message({processed_df <- xportr_type(df, metacore_meta)}, NA) expect_equal(lapply(df, class), lapply(processed_df, class)) expect_equal(df$RFICDT, processed_df$RFICDT) expect_equal(df$RFICDTM, processed_df$RFICDTM) - xportr_write(processed_df, file.path(system.file("extdata", package="xportr"), "dfdates.xpt")) - df_xpt <- read_xpt(file.path(system.file("extdata", package="xportr"), "dfdates.xpt")) + xportr_write(processed_df, file.path(tempdir(), "dfdates.xpt")) + df_xpt <- read_xpt(file.path(tempdir(), "dfdates.xpt")) expect_equal(lapply(df, class), lapply(df_xpt, class)) expect_equal(df$RFICDT, df_xpt$RFICDT, ignore_attr = TRUE) @@ -211,10 +211,11 @@ test_that("xportr_type: date variables are not converted to numeric", { format = c(NA, NA, "date9.", "datetime15.") ) - adsl_original <- tibble::tribble( - ~USUBJID, ~DMDTC, ~RFICDT, ~RFICDTM, - "test1", "2017-03-30", "2017-03-30", "2017-03-30", - "test2", "2017-01-08", "2017-01-08", "2017-01-08" + adsl_original <- data.frame( + USUBJID = c("test1", "test2"), + DMDTC = c("2017-03-30", "2017-01-08"), + RFICDT = c("2017-03-30", "2017-01-08"), + RFICDTM = c("2017-03-30", "2017-01-08") ) @@ -227,7 +228,7 @@ test_that("xportr_type: date variables are not converted to numeric", { attr(adsl_original, "_xportr.df_arg_") <- "adsl_original" expect_equal(adsl_original, adsl_xpt2) - + }) test_that("xportr_type: Gets warning when metadata has multiple rows with same variable", { From 412c75de5dbef63cccae93f35b21217125259750 Mon Sep 17 00:00:00 2001 From: elimillera Date: Thu, 15 Jun 2023 13:17:29 +0000 Subject: [PATCH 12/23] Lint and style --- R/type.R | 1 - R/utils-xportr.R | 5 ++--- tests/testthat/test-type.R | 8 ++++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/R/type.R b/R/type.R index d69297f7..8fc44875 100644 --- a/R/type.R +++ b/R/type.R @@ -99,7 +99,6 @@ xportr_type <- function(.df, "_numeric", type.x ), - # type.x = if_else(grepl("DTC$", variable) & type.x == "_character", "Date", type.x), type.y = if_else(is.na(type.y), type.x, type.y), type.y = tolower(type.y), type.y = if_else(type.y %in% characterTypes | (grepl("DTC$", variable) & is.na(format)), "_character", type.y), diff --git a/R/utils-xportr.R b/R/utils-xportr.R index 1d3a60d8..91f2cb15 100644 --- a/R/utils-xportr.R +++ b/R/utils-xportr.R @@ -357,9 +357,8 @@ first_class <- function(x) { #' @param metadata A data frame containing variable level metadata. #' @param variable_name string with `getOption('xportr.variable_name')` #' @noRd -check_multiple_var_specs <- function( - metadata, - variable_name = getOption("xportr.variable_name")) { +check_multiple_var_specs <- function(metadata, + variable_name = getOption("xportr.variable_name")) { variable_len <- pluck(metadata, variable_name) %||% c() if (NROW(variable_len) != NROW(unique(variable_len))) { cli_alert_info( diff --git a/tests/testthat/test-type.R b/tests/testthat/test-type.R index a3f1aacf..541c14bb 100644 --- a/tests/testthat/test-type.R +++ b/tests/testthat/test-type.R @@ -192,7 +192,12 @@ test_that("xportr_type: date variables are not converted to numeric", { ) ) ) - expect_message({processed_df <- xportr_type(df, metacore_meta)}, NA) + expect_message( + { + processed_df <- xportr_type(df, metacore_meta) + }, + NA + ) expect_equal(lapply(df, class), lapply(processed_df, class)) expect_equal(df$RFICDT, processed_df$RFICDT) expect_equal(df$RFICDTM, processed_df$RFICDTM) @@ -228,7 +233,6 @@ test_that("xportr_type: date variables are not converted to numeric", { attr(adsl_original, "_xportr.df_arg_") <- "adsl_original" expect_equal(adsl_original, adsl_xpt2) - }) test_that("xportr_type: Gets warning when metadata has multiple rows with same variable", { From 88e5370bba3e2c811b79b16ede466b08dd57f9f5 Mon Sep 17 00:00:00 2001 From: vedhav Date: Thu, 11 May 2023 03:58:33 +0530 Subject: [PATCH 13/23] feat: adding the issue templates --- .github/ISSUE_TEMPLATE/01_bug_report.yml | 33 +++++++++++++++ .github/ISSUE_TEMPLATE/02_feature_request.yml | 41 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/01_bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/02_feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml new file mode 100644 index 00000000..bb70b4ab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_bug_report.yml @@ -0,0 +1,33 @@ +name: Bug Report +description: Something is not working correctly or is not working at all! +title: "Bug: " +labels: ["bug", "programming"] +body: + - type: markdown + attributes: + value: | + **Example:** Bug: xportr_format() does not assign SAS format for `DATE9.` variable level metadata + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us what were you expecting to happen before the bug? + placeholder: "A bug happened!" + validations: + required: true + - type: textarea + id: session-info + attributes: + label: Session Information + description: Use `sessionInfo()` in the R console to gather all the details of your environment when the bug happened. + placeholder: "Place the console output here" + validations: + required: false + - type: textarea + id: logs + attributes: + label: Reproducible Example + description: We love code that can reproduce the example. Check out [reprex](https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html) + placeholder: "Please give us as many details as you can! The faster we can recreate the bug, the faster we can get a fix in the works. Warning, Error Messages and Screenshots are also great." + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.yml b/.github/ISSUE_TEMPLATE/02_feature_request.yml new file mode 100644 index 00000000..cf7ea559 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_feature_request.yml @@ -0,0 +1,41 @@ +name: Feature Request +description: Enchancement to xportr functionality +title: "Feature Request: " +labels: ["enhancement", "programming"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this feature request! We love keeping xportr fresh! + - type: textarea + id: feature + attributes: + label: Feature Idea + description: Tell us your idea in as few words as possible + placeholder: "`xportr_validate` should do x, y and z" + validations: + required: true + - type: textarea + id: input + attributes: + label: Relevant Input + description: Can you provide what the inputs should look like? + placeholder: "What should the input look like? REMINDER: no patient level data or company sensitive information should be shared via this open public issue" + validations: + required: false + - type: textarea + id: output + attributes: + label: Relevant Output + description: Can you provide what the final output should look like? + placeholder: "What should the output look like? REMINDER: no patient level data or company sensitive information should be shared via this open public issue" + validations: + required: false + - type: textarea + id: code + attributes: + label: Reproducible Example/Pseudo Code + description: Can you provide a working example or a sketch of how the code should work? + placeholder: "We love example code and it will speed up the process! REMINDER: no patient level data or company sensitive information should be shared via this open public issue" + validations: + required: false From f291e9aae288da53634a7e78e966e2ed471a871c Mon Sep 17 00:00:00 2001 From: bs832471 Date: Thu, 11 May 2023 00:51:41 +0000 Subject: [PATCH 14/23] feat: #94 branch off main and implement PR templates --- .github/PULL_REQUEST_TEMPLATE/release.md | 22 +++++++++++++++++ .github/pull_request_template.md | 30 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE/release.md create mode 100644 .github/pull_request_template.md diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md new file mode 100644 index 00000000..d15938a3 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -0,0 +1,22 @@ +# Release Description + + +## Milestone + + +Milestone: + +# Release Checklist + + +- [ ] DESCRIPTION File version number has been updated +- [ ] DESCRIPTION file updated with New Developers (if applicable) +- [ ] NEWS.md has been updated and issues numbers linked +- [ ] README.md has been updated (if applicable) +- [ ] Vignettes have been updated (if applicable) +- [ ] Ensure all unit tests are passing +- [ ] Review https://r-pkgs.org/release.html for additional checks and guidance +- [ ] Use `rhub::check_for_cran()` for checking CRAN flavors before submission +- [ ] Use `usethis::use_revdep()` to check for any reverse dependencies +- [ ] GitHub actions on this PR are all passing +- [ ] Draft GitHub release created using automatic template and updated with additional details. Remember to click "release" after PR is merged. \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..a4786bff --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,30 @@ +### Thank you for your Pull Request! + +We have developed a Pull Request template to aid you and our reviewers. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the xportr codebase remains robust and consistent. + +### The scope of `{xportr}` + +`{xportr}`'s scope is to enable R users to write out submission compliant `xpt` files that can be delivered to a Health Authority or to downstream validation software programs. We see labels, lengths, types, ordering and formats from a dataset specification object (SDTM and ADaM) as being our primary focus. We also see messaging and warnings to users around applying information from the specification file as a primary focus. Please make sure your Pull Request meets this **scope of {xportr}**. If your Pull Request moves beyond this scope, please get in touch with the `{xportr}` team on [slack](https://pharmaverse.slack.com/archives/C030EB2M4GM) or create an issue to discuss. + +Please check off each task box as an acknowledgment that you completed the task. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the `devel` branch until you have checked off each task. + +### Changes Description + +_(descriptions of changes)_ + +### Task List + +- [ ] The spirit of xportr is met in your Pull Request +- [ ] Place Closes # into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update) +- [ ] Summary of changes filled out in the above Changes Description. Can be removed or left blank if changes are minor/self-explanatory. +- [ ] Check that your Pull Request is targeting the `devel` branch, Pull Requests to `main` should use the [Release Pull Request Template](https://github.com/atorus-research/xportr/tree/94_pr_template/.github/PULL_REQUEST_TEMPLATE) +- [ ] Code is formatted according to the [tidyverse style guide](https://style.tidyverse.org/). Use `styler` package and functions to style files accordingly. +- [ ] Updated relevant unit tests or have written new unit tests. See our [Wiki](https://github.com/atorus-research/xportr/wiki/Style-Guide-for-Unit-Tests) for conventions used in this package. +- [ ] Creation/updated relevant roxygen headers and examples. See our [Wiki](https://github.com/atorus-research/xportr/wiki/Style-Guide-for-Roxygen-Headers) for conventions used in this package. +- [ ] Run `devtools::document()` so all `.Rd` files in the `man` folder and the `NAMESPACE` file in the project root are updated appropriately +- [ ] Run `pkgdown::build_site()` and check that all affected examples are displayed correctly and that all new/updated functions occur on the "Reference" page. +- [ ] Update NEWS.md if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers) +- [ ] Address any updates needed for vignettes and/or templates +- [ ] Link the issue Development Panel so that it closes after successful merging. +- [ ] Fix merge conflicts +- [ ] Pat yourself on the back for a job well done! Much love to your accomplishment! From 495037d08505561360a167f400ee9c93c0d5d7a7 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Wed, 10 May 2023 20:55:22 -0400 Subject: [PATCH 15/23] fix: Update test-coverage.yaml to address failing CI --- .github/workflows/test-coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 0a44f49a..dadf5abe 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-pandoc@v1 From 50d109dbad8956813a52225c45309785eae1856d Mon Sep 17 00:00:00 2001 From: vedhav Date: Thu, 11 May 2023 16:30:04 +0530 Subject: [PATCH 16/23] fix: update the r setup action to fix CI --- .github/workflows/pkgdown.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 07dea56d..16404107 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-pandoc@v1 From b19838da78101c5cff68390954b523820d840149 Mon Sep 17 00:00:00 2001 From: vedhav Date: Thu, 11 May 2023 16:33:26 +0530 Subject: [PATCH 17/23] fix: update the setup in spellcheck CI as well --- .github/workflows/spellcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 353b9682..42c7e327 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -32,7 +32,7 @@ jobs: fetch-depth: 0 - name: Setup R 📊 - uses: r-lib/actions/setup-r@v1 + uses: r-lib/actions/setup-r@v2 with: r-version: 4.1.3 From f20899236c16065911ffea863b47d44456b97b82 Mon Sep 17 00:00:00 2001 From: Vedha Viyash <49812166+vedhav@users.noreply.github.com> Date: Thu, 11 May 2023 19:46:32 +0530 Subject: [PATCH 18/23] Update .github/ISSUE_TEMPLATE/01_bug_report.yml Co-authored-by: Ben Straub --- .github/ISSUE_TEMPLATE/01_bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml index bb70b4ab..10800caf 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/01_bug_report.yml @@ -6,7 +6,7 @@ body: - type: markdown attributes: value: | - **Example:** Bug: xportr_format() does not assign SAS format for `DATE9.` variable level metadata + **Example:** Bug: xportr_format() does not assign SAS format for `DATE9.` metadata - type: textarea id: what-happened attributes: From 1f9d2d297cd540483582f10d14673bb02c6a1bb1 Mon Sep 17 00:00:00 2001 From: Vedha Viyash <49812166+vedhav@users.noreply.github.com> Date: Thu, 11 May 2023 19:46:38 +0530 Subject: [PATCH 19/23] Update .github/ISSUE_TEMPLATE/01_bug_report.yml Co-authored-by: Ben Straub --- .github/ISSUE_TEMPLATE/01_bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml index 10800caf..c89cc92d 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/01_bug_report.yml @@ -27,7 +27,7 @@ body: id: logs attributes: label: Reproducible Example - description: We love code that can reproduce the example. Check out [reprex](https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html) + description: We love code that can reproduce the bug. Check out [reprex](https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html) placeholder: "Please give us as many details as you can! The faster we can recreate the bug, the faster we can get a fix in the works. Warning, Error Messages and Screenshots are also great." validations: required: false From 08aac591fa90fa33ea4d32e0028443d9d06f21ae Mon Sep 17 00:00:00 2001 From: Vedha Viyash <49812166+vedhav@users.noreply.github.com> Date: Thu, 11 May 2023 19:47:03 +0530 Subject: [PATCH 20/23] Update .github/ISSUE_TEMPLATE/02_feature_request.yml Co-authored-by: Ben Straub --- .github/ISSUE_TEMPLATE/02_feature_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.yml b/.github/ISSUE_TEMPLATE/02_feature_request.yml index cf7ea559..927c80bd 100644 --- a/.github/ISSUE_TEMPLATE/02_feature_request.yml +++ b/.github/ISSUE_TEMPLATE/02_feature_request.yml @@ -20,7 +20,7 @@ body: attributes: label: Relevant Input description: Can you provide what the inputs should look like? - placeholder: "What should the input look like? REMINDER: no patient level data or company sensitive information should be shared via this open public issue" + placeholder: "What should the input look like? REMINDER: No patient level data or company sensitive information should be shared via this open public issue" validations: required: false - type: textarea From fa52c8806a9eac8c20e41636515f7b789c2f0f59 Mon Sep 17 00:00:00 2001 From: Vedha Viyash <49812166+vedhav@users.noreply.github.com> Date: Thu, 11 May 2023 19:47:11 +0530 Subject: [PATCH 21/23] Update .github/ISSUE_TEMPLATE/02_feature_request.yml Co-authored-by: Ben Straub --- .github/ISSUE_TEMPLATE/02_feature_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.yml b/.github/ISSUE_TEMPLATE/02_feature_request.yml index 927c80bd..6a647481 100644 --- a/.github/ISSUE_TEMPLATE/02_feature_request.yml +++ b/.github/ISSUE_TEMPLATE/02_feature_request.yml @@ -28,7 +28,7 @@ body: attributes: label: Relevant Output description: Can you provide what the final output should look like? - placeholder: "What should the output look like? REMINDER: no patient level data or company sensitive information should be shared via this open public issue" + placeholder: "What should the output look like? REMINDER: No patient level data or company sensitive information should be shared via this open public issue" validations: required: false - type: textarea From 0635ab1890d77ee9c0d5c66e76ec821799f543a5 Mon Sep 17 00:00:00 2001 From: Vedha Viyash <49812166+vedhav@users.noreply.github.com> Date: Thu, 11 May 2023 19:47:18 +0530 Subject: [PATCH 22/23] Update .github/ISSUE_TEMPLATE/02_feature_request.yml Co-authored-by: Ben Straub --- .github/ISSUE_TEMPLATE/02_feature_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.yml b/.github/ISSUE_TEMPLATE/02_feature_request.yml index 6a647481..e0b2597d 100644 --- a/.github/ISSUE_TEMPLATE/02_feature_request.yml +++ b/.github/ISSUE_TEMPLATE/02_feature_request.yml @@ -36,6 +36,6 @@ body: attributes: label: Reproducible Example/Pseudo Code description: Can you provide a working example or a sketch of how the code should work? - placeholder: "We love example code and it will speed up the process! REMINDER: no patient level data or company sensitive information should be shared via this open public issue" + placeholder: "We love example code and it will speed up the process! REMINDER: No patient level data or company sensitive information should be shared via this open public issue" validations: required: false From ddc813b7a7823cb6f52c8c2170ff37bfc544d4e2 Mon Sep 17 00:00:00 2001 From: bs832471 Date: Thu, 15 Jun 2023 16:59:19 +0000 Subject: [PATCH 23/23] chore: #142 news update --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 423f40d3..59badb87 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,7 @@ * Added function `xportr_metadata()` to explicitly set metadata at the start of a pipeline (#44) * Metadata order columns are now coerced to numeric by default in `xportr_order()` to prevent character sorting (#149) * Message is shown on `xportr_*` functions when the metadata being used has multiple variables with the same name in the same domain (#128) +* Fixed an issue with `xport_type()` where `DT`, `DTM` variables with a format specified in the metadata (e.g. date9., datetime20.) were being converted to numeric, which will cause a 10 year difference when reading it back by `read_xpt()`. SAS's uniform start date is 1960 whereas Linux's uniform start date is 1970. ## Documentation