Nothing
case_match() is soft deprecatedCode
case_match(1, 1 ~ "x")
Condition
Warning:
`case_match()` was deprecated in dplyr 1.2.0.
i Please use `recode_values()` instead.
Output
[1] "x"
Code
case_match(1)
Condition
Error in `case_match()`:
! `...` can't be empty.
Code
case_match(1, NULL)
Condition
Error in `case_match()`:
! `...` can't be empty.
.default is part of common type computationCode
case_match(1, 1 ~ 1L, .default = "x")
Condition
Error in `case_match()`:
! Can't combine <integer> and `.default` <character>.
NULL formula element throws meaningful errorCode
case_match(1, 1 ~ NULL)
Condition
Error in `case_match()`:
! `..1 (right)` must be a vector, not `NULL`.
i Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
Code
case_match(1, NULL ~ 1)
Condition
Error in `case_match()`:
! `..1 (left)` must be a vector, not `NULL`.
i Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
Code
case_match(1, 1 ~ 2, 3 ~ stop("oh no!"))
Condition
Error in `case_match()`:
! Failed to evaluate the right-hand side of formula 2.
Caused by error:
! oh no!
Code
case_match(1, 1 ~ 2, stop("oh no!") ~ 4)
Condition
Error in `case_match()`:
! Failed to evaluate the left-hand side of formula 2.
Caused by error:
! oh no!
haystacks must be castable to needlesCode
vec_case_match(1L, haystacks = list(1.5), values = list(2))
Condition
Error in `vec_case_match()`:
! Can't convert from `haystacks[[1]]` <double> to <integer> due to loss of precision.
* Locations: 1
ptype overrides values common typeCode
vec_case_match(1:2, haystacks = list(1), values = list(1.5), ptype = integer())
Condition
Error in `vec_case_match()`:
! Can't convert from `values[[1]]` <double> to <integer> due to loss of precision.
* Locations: 1
default respects ptypeCode
vec_case_match(needles = 1, haystacks = list(1), values = list(2L), default = 1.5,
ptype = integer())
Condition
Error in `vec_case_match()`:
! Can't convert from `default` <double> to <integer> due to loss of precision.
* Locations: 1
NULL values in haystacks and values are not droppedCode
vec_case_match(1:2, list(1, NULL, 2), list("a", NULL, "b"))
Condition
Error in `vec_case_match()`:
! `haystacks[[2]]` must be a vector, not `NULL`.
i Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
Code
vec_case_match(1:2, list(1, NULL, 2), list("a", "a", "b"))
Condition
Error in `vec_case_match()`:
! `haystacks[[2]]` must be a vector, not `NULL`.
i Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
Code
vec_case_match(1:2, list(1, 1, 2), list("a", NULL, "b"))
Condition
Error in `vec_case_match()`:
! `values[[2]]` must be a vector, not `NULL`.
i Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
needles is maintainedCode
vec_case_match(1, haystacks = list(1), values = list(1:2))
Condition
Error in `vec_case_match()`:
! Can't recycle `values[[1]]` (size 2) to size 1.
Code
vec_case_match(environment(), haystacks = list(environment()), values = list(1))
Condition
Error in `vec_case_match()`:
! `needles` must be a vector, not an environment.
i Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
haystacks must be a listCode
vec_case_match(1, haystacks = 1, values = list(2))
Condition
Error in `vec_case_match()`:
! `haystacks` must be a list, not the number 1.
values must be a listCode
vec_case_match(1, haystacks = list(1), values = 2)
Condition
Error in `vec_case_match()`:
! `values` must be a list, not the number 2.
needles_arg is respectedCode
vec_case_match(needles = environment(), haystacks = list(environment()),
values = list(1), needles_arg = "foo")
Condition
Error in `vec_case_match()`:
! `foo` must be a vector, not an environment.
i Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
Code
vec_case_match(needles = environment(), haystacks = list(environment()),
values = list(1), needles_arg = "")
Condition
Error in `vec_case_match()`:
! Input must be a vector, not an environment.
i Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
haystacks_arg is respectedCode
vec_case_match(needles = 1, haystacks = 1, values = list(1), haystacks_arg = "foo")
Condition
Error in `vec_case_match()`:
! `foo` must be a list, not the number 1.
Code
vec_case_match(needles = 1, haystacks = 1, values = list(1), haystacks_arg = "")
Condition
Error in `vec_case_match()`:
! Input must be a list, not the number 1.
Code
vec_case_match(needles = 1, haystacks = list(a = "x"), values = list(1),
haystacks_arg = "foo")
Condition
Error in `vec_case_match()`:
! Can't convert `foo$a` <character> to <double>.
Code
vec_case_match(needles = 1, haystacks = list("x"), values = list(1),
haystacks_arg = "")
Condition
Error in `vec_case_match()`:
! Can't convert `..1` <character> to <double>.
values_arg is respectedCode
vec_case_match(needles = 1, haystacks = list(1, 2), values = list("x", b = 1),
values_arg = "foo")
Condition
Error in `vec_case_match()`:
! Can't combine `foo[[1]]` <character> and `foo$b` <double>.
Code
vec_case_match(needles = 1, haystacks = list(1, 2), values = list("x", b = 1),
values_arg = "")
Condition
Error in `vec_case_match()`:
! Can't combine `..1` <character> and `b` <double>.
default_arg is respectedCode
vec_case_match(needles = 1, haystacks = list(1), values = list(2L), default = 1.5,
default_arg = "foo", ptype = integer())
Condition
Error in `vec_case_match()`:
! Can't convert from `foo` <double> to <integer> due to loss of precision.
* Locations: 1
Code
vec_case_match(needles = 1, haystacks = list(1), values = list(2L), default = 1.5,
default_arg = "", ptype = integer())
Condition
Error in `vec_case_match()`:
! Can't convert from <double> to <integer> due to loss of precision.
* Locations: 1
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.