Code
(expect_error(phop_index_vec(list(1:2, 1:2), 1:2, 1:2, 1:2, fn, .ptype = NULL),
class = "vctrs_error_incompatible_type"))
Output
<error/vctrs_error_ptype2>
Error in `phop_index_vec()`:
! Can't combine `out[[1]]` <double> and `out[[2]]` <character>.
.ptype = NULL
validates that element lengths are 1Code
phop_index_vec(list(1:2, 1:2), 1:2, 1:2, 1:2, ~ if (.x == 1L) {
1:2
} else {
1
}, .ptype = NULL)
Condition
Error:
i In index: 1
! The result of `.f` must have size 1, not 2.
Code
phop_index_vec(list(1:2, 1:2), 1:2, 1:2, 1:2, ~ if (.x == 1L) {
NULL
} else {
2
}, .ptype = NULL)
Condition
Error:
i In index: 1
! The result of `.f` must have size 1, not 0.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.