diff --git a/NAMESPACE b/NAMESPACE index 4c7d13f3..bedd0b74 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -50,7 +50,6 @@ export(get_new_tmp_var) export(get_source_vars) export(inner_join) export(is_auto) -export(is_named) export(is_order_vars) export(is_valid_dtc) export(left_join) @@ -166,6 +165,7 @@ importFrom(rlang,is_formula) importFrom(rlang,is_integerish) importFrom(rlang,is_logical) importFrom(rlang,is_missing) +importFrom(rlang,is_named) importFrom(rlang,is_quosure) importFrom(rlang,is_symbol) importFrom(rlang,is_symbolic) diff --git a/NEWS.md b/NEWS.md index 4ea9c618..66e00cdb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,7 +6,9 @@ ## Breaking Changes -* `renv` and related files have been removed (#360) +* `renv` and related files have been removed. (#360) + +* No longer exporting `is_named()` function. (#401) ## Documentation diff --git a/R/admiraldev-package.R b/R/admiraldev-package.R index 7a3db046..ac293bee 100644 --- a/R/admiraldev-package.R +++ b/R/admiraldev-package.R @@ -6,7 +6,7 @@ #' @importFrom magrittr %>% #' @importFrom rlang := abort arg_match as_function as_label as_name as_string #' call2 caller_env call_name current_env .data enexpr enquo eval_bare -#' eval_tidy expr expr_interp expr_label exprs f_lhs f_rhs inform missing_arg +#' eval_tidy expr expr_interp expr_label exprs f_lhs f_rhs is_named inform missing_arg #' is_bare_formula is_call is_character is_expression is_formula is_integerish #' is_logical is_missing is_quosure is_symbol is_symbolic new_formula #' parse_expr parse_exprs quo quo_is_missing quo_is_null set_names sym syms diff --git a/R/assertions.R b/R/assertions.R index dfa7469b..6c4e0efa 100644 --- a/R/assertions.R +++ b/R/assertions.R @@ -962,7 +962,7 @@ assert_named <- function(arg, optional = FALSE, } # if argument is greater than length 0 and all element named, return arg invisibly - any_unnamed <- length(arg) > 0L && !rlang::is_named(arg) + any_unnamed <- length(arg) > 0L && !is_named(arg) if (isFALSE(any_unnamed)) { return(invisible(arg)) } diff --git a/R/is.R b/R/is.R index 6ca52d68..73cf60e9 100644 --- a/R/is.R +++ b/R/is.R @@ -1,17 +1,3 @@ -#' Is a named argument -#' -#' @param x Any R object -#' -#' @return `TRUE` if the argument is named, `FALSE` otherwise -#' @export -#' -#' @keywords is -#' @family is -#' @export -is_named <- function(x) { - !is.null(names(x)) && all(names(x) != "") -} - #' Checks if the argument equals the auto keyword #' #' @param arg argument to check diff --git a/man/is_auto.Rd b/man/is_auto.Rd index 3fc94ae5..42c8aa62 100644 --- a/man/is_auto.Rd +++ b/man/is_auto.Rd @@ -18,7 +18,6 @@ Checks if the argument equals the auto keyword } \seealso{ Identifies type of Object with return of TRUE/FALSE: -\code{\link{is_named}()}, \code{\link{is_order_vars}()}, \code{\link{is_valid_dtc}()} } diff --git a/man/is_named.Rd b/man/is_named.Rd deleted file mode 100644 index 5e51c09e..00000000 --- a/man/is_named.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/is.R -\name{is_named} -\alias{is_named} -\title{Is a named argument} -\usage{ -is_named(x) -} -\arguments{ -\item{x}{Any R object} -} -\value{ -\code{TRUE} if the argument is named, \code{FALSE} otherwise -} -\description{ -Is a named argument -} -\seealso{ -Identifies type of Object with return of TRUE/FALSE: -\code{\link{is_auto}()}, -\code{\link{is_order_vars}()}, -\code{\link{is_valid_dtc}()} -} -\concept{is} -\keyword{is} diff --git a/man/is_order_vars.Rd b/man/is_order_vars.Rd index 41a94c76..5db7097b 100644 --- a/man/is_order_vars.Rd +++ b/man/is_order_vars.Rd @@ -18,7 +18,6 @@ Check if inputs are created using \code{exprs()} or calls involving \code{desc() \seealso{ Identifies type of Object with return of TRUE/FALSE: \code{\link{is_auto}()}, -\code{\link{is_named}()}, \code{\link{is_valid_dtc}()} } \concept{is} diff --git a/man/is_valid_dtc.Rd b/man/is_valid_dtc.Rd index 6d48f20d..7d74b6fb 100644 --- a/man/is_valid_dtc.Rd +++ b/man/is_valid_dtc.Rd @@ -18,7 +18,6 @@ Is this string a valid DTC \seealso{ Identifies type of Object with return of TRUE/FALSE: \code{\link{is_auto}()}, -\code{\link{is_named}()}, \code{\link{is_order_vars}()} } \concept{is}