check_data(data.frame(fac = factor(c("a", "b", "z"), levels = c("a", "z", "b"))),
list(fac = factor(c("a", "b", "z"), levels = c("a", "z", "b"))))
gives the error
Error in `check_dim()` at chk/R/check-data.R:41:3:
! `x_name` must be a string (non-missing character scalar).
Run `rlang::last_trace()` to see where the error occurred.
because backtick_chk(deparse(substitute(x))) returns the character vector of length 2
[1] "`data.frame(fac = factor(c(\"a\", \"b\", \"z\"), levels = c(\"a\", \"z\", `"
[2] "` \"b\")))`"`
Despite this bug being a likely uncommon edge case, I think the bug is worth fixing because the error is quite uninterpretable without debugging.
We could:
- only use first string (and append "..." to the end of it?)
- collapse the elements with
p0(..., collapse = "")
- indenting of the second element can probably be dropped, since the first line ends with a space, but this may not always be the case
gives the error
because
backtick_chk(deparse(substitute(x)))returns the character vector of length 2Despite this bug being a likely uncommon edge case, I think the bug is worth fixing because the error is quite uninterpretable without debugging.
We could:
p0(..., collapse = "")