From 5bc2f1ed294719ab11270e828776228d78cbfec9 Mon Sep 17 00:00:00 2001 From: Chris Hartgerink Date: Wed, 11 Sep 2024 09:42:01 +0200 Subject: [PATCH] Fix checks --- DESCRIPTION | 2 +- R/datatagr-package.R | 2 +- R/square_bracket.R | 6 +++--- R/type.R | 6 ++---- inst/WORDLIST | 2 ++ man/datatagr-package.Rd | 2 +- man/sub_datatagr.Rd | 6 +++--- man/type.Rd | 6 ++---- 8 files changed, 15 insertions(+), 17 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ef55821..de418a8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,7 +5,7 @@ Authors@R: c( person("Chris", "Hartgerink", , "chris@data.org", role = "cre", comment = c(ORCID = "0000-0003-1050-6809")) ) -Description: Provides tools to help label and validate data according to user-specified rules. The 'datatagr' class adds variable level attributes to 'data.frame'columns. Once labelled, these variables can be seamlessly used in downstream analyses, making data pipelines clearer, more robust, and more reliable. +Description: Provides tools to help label and validate data according to user-specified rules. The 'datatagr' class adds variable level attributes to 'data.frame' columns. Once labelled, these variables can be seamlessly used in downstream analyses, making data pipelines clearer, more robust, and more reliable. License: MIT + file LICENSE URL: https://epiverse-trace.github.io/datatagr/, https://github.com/epiverse-trace/datatagr BugReports: https://github.com/epiverse-trace/datatagr/issues diff --git a/R/datatagr-package.R b/R/datatagr-package.R index 5dcd0dc..253281a 100644 --- a/R/datatagr-package.R +++ b/R/datatagr-package.R @@ -41,7 +41,7 @@ #' * `print()`: prints info about the `datatagr` in addition to the #' `data.frame` or `tibble` #' -#' @note The package does not aim to have complete integration with [dplyr] +#' @note The package does not aim to have complete integration with \pkg{dplyr} #' functions. For example, [dplyr::mutate()] and [dplyr::bind_rows()] will #' not preserve labels. We only provide compatibility for [dplyr::rename()]. #' diff --git a/R/square_bracket.R b/R/square_bracket.R index a7f5656..d372841 100644 --- a/R/square_bracket.R +++ b/R/square_bracket.R @@ -34,11 +34,11 @@ #' ## create a datatagr #' x <- cars %>% #' make_datatagr( -#' mph = "speed", -#' distance = "dist" +#' speed = "Miles per hour", +#' dist = "Distance in miles" #' ) %>% #' mutate(result = if_else(speed > 50, "fast", "slow")) %>% -#' set_labels(ticket = "result") +#' set_labels(result = "Ticket") #' x #' #' ## dangerous removal of a labelled column setting it to NULL issues a warning diff --git a/R/type.R b/R/type.R index b4bc1e9..805751d 100644 --- a/R/type.R +++ b/R/type.R @@ -18,10 +18,8 @@ #' #' validate_types( #' x, -#' types( -#' speed = type("numeric"), -#' dist = "integer" -#' ) +#' speed = type("numeric"), +#' dist = "numeric" #' ) #' type <- function(x) { diff --git a/inst/WORDLIST b/inst/WORDLIST index dedbd53..98e501a 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -3,6 +3,8 @@ Codecov Lifecycle ORCID RECON +Unlabeled +dplyr lifecycle linelist tidyverse diff --git a/man/datatagr-package.Rd b/man/datatagr-package.Rd index e9766d7..c381fd7 100644 --- a/man/datatagr-package.Rd +++ b/man/datatagr-package.Rd @@ -12,7 +12,7 @@ Once tagged, these variables can be seamlessly used in downstream analyses, making data pipelines more robust and reliable. } \note{ -The package does not aim to have complete integration with \link{dplyr} +The package does not aim to have complete integration with \pkg{dplyr} functions. For example, \code{\link[dplyr:mutate]{dplyr::mutate()}} and \code{\link[dplyr:bind_rows]{dplyr::bind_rows()}} will not preserve labels. We only provide compatibility for \code{\link[dplyr:rename]{dplyr::rename()}}. } diff --git a/man/sub_datatagr.Rd b/man/sub_datatagr.Rd index b0a6a25..76a62ba 100644 --- a/man/sub_datatagr.Rd +++ b/man/sub_datatagr.Rd @@ -52,11 +52,11 @@ if (require(dplyr) && require(magrittr)) { ## create a datatagr x <- cars \%>\% make_datatagr( - mph = "speed", - distance = "dist" + speed = "Miles per hour", + dist = "Distance in miles" ) \%>\% mutate(result = if_else(speed > 50, "fast", "slow")) \%>\% - set_labels(ticket = "result") + set_labels(result = "Ticket") x ## dangerous removal of a labelled column setting it to NULL issues a warning diff --git a/man/type.Rd b/man/type.Rd index a72ceb4..a6d3c13 100644 --- a/man/type.Rd +++ b/man/type.Rd @@ -26,10 +26,8 @@ x <- make_datatagr(cars, validate_types( x, - types( - speed = type("numeric"), - dist = "integer" - ) + speed = type("numeric"), + dist = "numeric" ) }