for slide.R and changing all the rlang::abort to cli_abort - #526
Conversation
… abort, they have been changed to proper syntax for cli_abort.
|
@PriKalra Thanks a bunch for this PR and the others! I'm just dropping in quickly to say that I'm OOO until the week after next but will get to this after my return. |
- evaluate `arg` to keep errors informative - what the arg actually was will come via type checkers
|
|
||
| if (!is.data.frame(data)) { | ||
| cli_abort("{.arg data} must be a {.cls data frame}.") | ||
| cli_abort("{.arg data} must be a data frame.") |
There was a problem hiding this comment.
The reason for this change is a fairly subtle one: "data frame" refers to data frames in general, both of the base-R data.frame flavour and of the tibble flavour. We could use {.cls data.frame} here because tibbles are also data.frames but the error might suggest tibbles are not allowed if a user doesn't know this technical detail. Therefore I'm sticking with the general "data frame" here.
data.frame(x = 10) |> class()
#> [1] "data.frame"
tibble::tibble(x = 10) |> class()
#> [1] "tbl_df" "tbl" "data.frame"Created on 2024-09-09 with reprex v2.1.0
|
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
changed all rlang::abort to cli_abort. There were lot of paste0 rlang abort, they have been changed to proper syntax for cli_abort.
fixes #513