Skip to content

Commit

Permalink
use text_concatenate
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 4, 2024
1 parent 75c1413 commit ed4221d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/data_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,11 @@ data_summary.grouped_df <- function(x, ..., by = NULL, include_na = TRUE) {
# check for correct length of output - must be a single value!
if (any(lengths(out) != 1)) {
insight::format_error(
"Each expression must return a single value. Following expressions returned more than one value:",
paste0(
"`",
vapply(dots[lengths(out) != 1], insight::safe_deparse, character(1)),
"`",
collapse = ", "
"Each expression must return a single value. Following expression",
ifelse(sum(lengths(out) != 1) > 1, "s", " "),
" returned more than one value: ",
text_concatenate(vapply(dots[lengths(out) != 1], insight::safe_deparse, character(1)), enclose = "\"")
)
)
}
Expand Down

0 comments on commit ed4221d

Please sign in to comment.