Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
^LICENSE\.md$
^\.github$
^CRAN-SUBMISSION$
^[.]?air[.]toml$
^\.vscode$
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"Posit.air-vscode"
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"[r]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "Posit.air-vscode"
},
"[quarto]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "quarto.quarto"
}
}
30 changes: 15 additions & 15 deletions R/compat-obj-type.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# - Added documentation.
# - Added changelog.


#' Return English-friendly type
#' @param x Any R object.
#' @param value Whether to describe the value of `x`. Special values
Expand Down Expand Up @@ -73,12 +72,11 @@ obj_type_friendly <- function(x, value = TRUE) {
typeof(x),
logical = "`NA`",
integer = "an integer `NA`",
double =
if (is.nan(x)) {
"`NaN`"
} else {
"a numeric `NA`"
},
double = if (is.nan(x)) {
"`NaN`"
} else {
"a numeric `NA`"
},
complex = "a complex `NA`",
character = "a character `NA`",
.rlang_stop_unexpected_typeof(x)
Expand Down Expand Up @@ -280,14 +278,16 @@ obj_type_oo <- function(x) {
#' @param ... Arguments passed to [abort()].
#' @inheritParams args_error_context
#' @noRd
stop_input_type <- function(x,
what,
...,
allow_na = FALSE,
allow_null = FALSE,
show_value = TRUE,
arg = caller_arg(x),
call = caller_env()) {
stop_input_type <- function(
x,
what,
...,
allow_na = FALSE,
allow_null = FALSE,
show_value = TRUE,
arg = caller_arg(x),
call = caller_env()
) {
# From compat-cli.R
cli <- env_get_list(
nms = c("format_arg", "format_code"),
Expand Down
16 changes: 10 additions & 6 deletions R/compat-purrr.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,16 @@ args_recycle <- function(args) {
}
pmap <- function(.l, .f, ...) {
args <- args_recycle(.l)
do.call("mapply", c(
FUN = list(quote(.f)),
args, MoreArgs = quote(list(...)),
SIMPLIFY = FALSE, USE.NAMES = FALSE
))
do.call(
"mapply",
c(
FUN = list(quote(.f)),
args,
MoreArgs = quote(list(...)),
SIMPLIFY = FALSE,
USE.NAMES = FALSE
)
)
}

probe <- function(.x, .p, ...) {
Expand Down Expand Up @@ -200,5 +205,4 @@ vec_index <- function(x) {
names(x) %||% seq_along(x)
}


# nocov end
Loading
Loading