Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] pipe friendly assert/test statements #247

Open
vorpalvorpal opened this issue Oct 16, 2023 · 0 comments
Open

[feature request] pipe friendly assert/test statements #247

vorpalvorpal opened this issue Oct 16, 2023 · 0 comments

Comments

@vorpalvorpal
Copy link

At present the following works:

library(tidyverse)
library(checkmate)

tibble(a = c(1,2)) |>
  mutate(a = assert_numeric(a)) |>
  # continue with pipe

However, it feels like a waste to replace a with the output of assert_numeric (which is of course equal to a). Would it be possible to instead have a dplyr style function along the lines of:

tibble(a = c(1,2)) |>
  check(test_numeric(a)) |>
  # continue with pipe

where check() does dplyr style data-masking and then just returns its input (or raises an error).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant