From 60db2b03796fe858b4b8f636a94cf61fb3a89ae4 Mon Sep 17 00:00:00 2001 From: elimillera Date: Fri, 11 Aug 2023 18:11:39 +0000 Subject: [PATCH 1/2] Resolve CRAN issue. Remove experimental from readme. export xpt_validate --- DESCRIPTION | 2 +- NAMESPACE | 1 + R/support-test.R | 1 + R/utils-xportr.R | 8 ++++++-- README.Rmd | 3 +-- README.md | 6 ++---- man/local_cli_theme.Rd | 17 ----------------- man/xpt_validate.Rd | 18 ++++++++++++++++++ 8 files changed, 30 insertions(+), 26 deletions(-) delete mode 100644 man/local_cli_theme.Rd create mode 100644 man/xpt_validate.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 75421e2d..61e81239 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: xportr Title: Utilities to Output CDISC SDTM/ADaM XPT Files -Version: 0.3.0 +Version: 0.3.1 Authors@R: c( person(given = "Eli", diff --git a/NAMESPACE b/NAMESPACE index 9e7b061b..2b7d1412 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -14,6 +14,7 @@ export(xportr_metadata) export(xportr_order) export(xportr_type) export(xportr_write) +export(xpt_validate) import(haven) import(rlang) importFrom(cli,cli_alert_danger) diff --git a/R/support-test.R b/R/support-test.R index fa6e1c4f..e12a6650 100644 --- a/R/support-test.R +++ b/R/support-test.R @@ -111,6 +111,7 @@ minimal_metadata <- function(dataset = FALSE, #' @param `[environment(1)]`\cr Attach exit handlers to this environment. Typically, this should #' be either the current environment or a parent frame #' (accessed through parent.frame()). +#' @noRd #' @keywords internal local_cli_theme <- function(.local_envir = parent.frame()) { cli_theme_tests <- list( diff --git a/R/utils-xportr.R b/R/utils-xportr.R index 91f2cb15..ef37d1db 100644 --- a/R/utils-xportr.R +++ b/R/utils-xportr.R @@ -175,10 +175,14 @@ xpt_validate_var_names <- function(varnames, #' Validate Dataset Can be Written to xpt #' +#' Function used to validate xpt files before they are sent to `haven::write_xpt` +#' for writing. +#' #' @param data Dataset to be exported as xpt file #' -#' @return xpt file -#' @noRd +#' @return Returns a character vector of failed conditions +#' +#' @export xpt_validate <- function(data) { err_cnd <- character() diff --git a/README.Rmd b/README.Rmd index d7d92e30..6536ac6d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -21,9 +21,8 @@ library(fontawesome) [](https://RValidationHub.slack.com) [![R build status](https://github.com/atorus-research/xportr/workflows/R-CMD-check/badge.svg)](https://github.com/atorus-research/xportr/actions?workflow=R-CMD-check) -[](https://app.codecov.io/gh/atorus-research/xportr) +[](https://app.codecov.io/gh/atorus-research/xportr) [](https://github.com/atorus-research/xportr/blob/master/LICENSE) -[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental-1) diff --git a/README.md b/README.md index 03e9cf00..bbd581f9 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,8 @@ [](https://RValidationHub.slack.com) [![R build status](https://github.com/atorus-research/xportr/workflows/R-CMD-check/badge.svg)](https://github.com/atorus-research/xportr/actions?workflow=R-CMD-check) -[](https://app.codecov.io/gh/atorus-research/xportr) +[](https://app.codecov.io/gh/atorus-research/xportr) [](https://github.com/atorus-research/xportr/blob/master/LICENSE) -[![Lifecycle: -experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental-1) Welcome to `xportr`! We have designed `xportr` to help get your xpt @@ -141,7 +139,7 @@ adsl %>% xportr_length(var_spec, "ADSL", verbose = "warn") %>% xportr_label(var_spec, "ADSL", verbose = "warn") %>% xportr_order(var_spec, "ADSL", verbose = "warn") %>% - xportr_format(var_spec, "ADSL", verbose = "warn") %>% + xportr_format(var_spec, "ADSL") %>% xportr_write("adsl.xpt", label = "Subject-Level Analysis Dataset") ``` diff --git a/man/local_cli_theme.Rd b/man/local_cli_theme.Rd deleted file mode 100644 index 959204d1..00000000 --- a/man/local_cli_theme.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/support-test.R -\name{local_cli_theme} -\alias{local_cli_theme} -\title{Local function to remove extra spaces and format by cli} -\usage{ -local_cli_theme(.local_envir = parent.frame()) -} -\arguments{ -\item{`[environment(1)]`\cr}{Attach exit handlers to this environment. Typically, this should -be either the current environment or a parent frame -(accessed through parent.frame()).} -} -\description{ -Groups together multiple calls instead of being spread out in code -} -\keyword{internal} diff --git a/man/xpt_validate.Rd b/man/xpt_validate.Rd new file mode 100644 index 00000000..4b43e396 --- /dev/null +++ b/man/xpt_validate.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils-xportr.R +\name{xpt_validate} +\alias{xpt_validate} +\title{Validate Dataset Can be Written to xpt} +\usage{ +xpt_validate(data) +} +\arguments{ +\item{data}{Dataset to be exported as xpt file} +} +\value{ +Returns a character vector of failed conditions +} +\description{ +Function used to validate xpt files before they are sent to \code{haven::write_xpt} +for writing. +} From 3fab1e327969b079383a5bfdc4cb23249f1aed89 Mon Sep 17 00:00:00 2001 From: elimillera Date: Fri, 11 Aug 2023 18:22:43 +0000 Subject: [PATCH 2/2] fix spacing --- R/utils-xportr.R | 4 ++-- man/xpt_validate.Rd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/utils-xportr.R b/R/utils-xportr.R index ef37d1db..06e1684f 100644 --- a/R/utils-xportr.R +++ b/R/utils-xportr.R @@ -175,8 +175,8 @@ xpt_validate_var_names <- function(varnames, #' Validate Dataset Can be Written to xpt #' -#' Function used to validate xpt files before they are sent to `haven::write_xpt` -#' for writing. +#' Function used to validate dataframes before they are sent to +#' `haven::write_xpt` for writing. #' #' @param data Dataset to be exported as xpt file #' diff --git a/man/xpt_validate.Rd b/man/xpt_validate.Rd index 4b43e396..bda4c5e1 100644 --- a/man/xpt_validate.Rd +++ b/man/xpt_validate.Rd @@ -13,6 +13,6 @@ xpt_validate(data) Returns a character vector of failed conditions } \description{ -Function used to validate xpt files before they are sent to \code{haven::write_xpt} -for writing. +Function used to validate dataframes before they are sent to +\code{haven::write_xpt} for writing. }