From d347f9fe471fa2a793d79af96998d29d5ca148c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Thu, 12 Oct 2023 17:21:32 +0200 Subject: [PATCH] refactor: lint 1 script --- R/spq_select.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/spq_select.R b/R/spq_select.R index af404855..09d38f15 100644 --- a/R/spq_select.R +++ b/R/spq_select.R @@ -1,6 +1,7 @@ #' Select (and create) particular variables #' @inheritParams spq_arrange -#' @param .spq_duplicate How to handle duplicates: keep them (`NULL`), eliminate (`distinct`) +#' @param .spq_duplicate How to handle duplicates: keep them (`NULL`), +#' eliminate (`distinct`) #' or reduce them (`reduced`, advanced usage). #' @return A query object #' @export @@ -8,13 +9,13 @@ #' #' query = spq_init() #' spq_select(query, count = n (human), eyecolor_label, haircolor_label) -spq_select = function(.query = NULL, ..., .spq_duplicate = NULL){ +spq_select = function(.query = NULL, ..., .spq_duplicate = NULL) { if (!is.null(.spq_duplicate)) { original_spq_duplicate <- .spq_duplicate .spq_duplicate <- toupper(.spq_duplicate) if (!(.spq_duplicate %in% c("DISTINCT", "REDUCED"))) { - rlang::abort(c( - x = sprintf("Wrong value for `.spq_duplicate` argument (%s).", original_spq_duplicate), + cli::cli_abort(c( + x = "Wrong value for {.arg .spq_duplicate} argument ({original_spq_duplicate}).", i = 'Use either `NULL`, "distinct" or "reduced".' ) )