.x
must be a vectorCode
(expect_error(slide_period(call("fn")), class = "vctrs_error_scalar_type"))
Output
<error/vctrs_error_scalar_type>
Error in `slide_period()`:
! `.x` must be a vector, not a call.
Code
(expect_error(slide_period(1, new_date(c(1, 2)), "year", identity), class = "slider_error_index_incompatible_size")
)
Output
<error/slider_error_index_incompatible_size>
Error in `slide_period()`:
! `.i` must have size 1, not 2.
Code
(expect_error(slide_period(1:2, new_date(c(2, 1)), "year", identity), class = "slider_error_index_must_be_ascending")
)
Output
<error/slider_error_index_must_be_ascending>
Error in `slide_period()`:
i In locations: 2
! `.i` must be in ascending order.
Code
(expect_error(slide_period(integer(), new_date(0), "year", ~.x), class = "slider_error_index_incompatible_size")
)
Output
<error/slider_error_index_incompatible_size>
Error in `slide_period()`:
! `.i` must have size 0, not 1.
Code
(expect_error(slide_period(1:2, new_date(c(1, NA)), "year", identity), class = "slider_error_index_cannot_be_na")
)
Output
<error/slider_error_index_cannot_be_na>
Error in `slide_period()`:
i In locations: 2
! `.i` can't be `NA`.
Code
(expect_error(slide_period(1:2, new_date(c(NA, 1)), "year", identity), class = "slider_error_index_cannot_be_na")
)
Output
<error/slider_error_index_cannot_be_na>
Error in `slide_period()`:
i In locations: 1
! `.i` can't be `NA`.
.before
range cannot be after .after
rangeCode
slide_period(1:3, i, "month", identity, .before = -1)
Condition
Error:
i In locations: 1, 2, and 3
i In the ranges generated by `.before` and `.after`:
! The start of the range can't be after the end of the range.
.before
cannot be NACode
slide_period(1, new_date(0), "year", identity, .before = NA_integer_)
Condition
Error in `slide_period()`:
! `.before` can't be `NA`.
.before
cannot be -InfCode
(expect_error(slide_period(1, new_date(0), "year", identity, .before = -Inf),
class = "vctrs_error_cast_lossy"))
Output
<error/vctrs_error_cast_lossy>
Error in `slide_period()`:
! Can't convert from `.before` <double> to <integer> due to loss of precision.
* Locations: 1
Code
expect_error(slide_period(1, new_date(0), "year", identity, .before = c(1L, 2L)),
class = "vctrs_error_assert_size")
Code
expect_error(slide_period(1, new_date(0), "year", identity, .before = NULL),
class = "vctrs_error_scalar_type")
.after
range cannot be before .before
rangeCode
slide_period(1:3, i, "month", identity, .after = -1)
Condition
Error:
i In locations: 1, 2, and 3
i In the ranges generated by `.before` and `.after`:
! The start of the range can't be after the end of the range.
.after
cannot be NACode
slide_period(1, new_date(0), "year", identity, .after = NA_integer_)
Condition
Error in `slide_period()`:
! `.after` can't be `NA`.
.after
cannot be -InfCode
(expect_error(slide_period(1, new_date(0), "year", identity, .after = -Inf),
class = "vctrs_error_cast_lossy"))
Output
<error/vctrs_error_cast_lossy>
Error in `slide_period()`:
! Can't convert from `.after` <double> to <integer> due to loss of precision.
* Locations: 1
Code
(expect_error(slide_period(1, new_date(0), "year", identity, .after = c(1L, 2L)),
class = "vctrs_error_assert_size"))
Output
<error/vctrs_error_assert_size>
Error in `slide_period()`:
! `.after` must have size 1, not size 2.
Code
(expect_error(slide_period(1, new_date(0), "year", identity, .after = NULL),
class = "vctrs_error_scalar_type"))
Output
<error/vctrs_error_scalar_type>
Error in `slide_period()`:
! `.after` must be a vector, not `NULL`.
.complete
cannot be NACode
slide_period(1, new_date(0), "year", identity, .complete = NA)
Condition
Error in `slide_period()`:
! `.complete` can't be `NA`.
Code
expect_error(slide_period(1, new_date(0), "year", identity, .complete = c(TRUE,
FALSE)), class = "vctrs_error_assert_size")
Code
expect_error(slide_period(1, new_date(0), "year", identity, .complete = NULL),
class = "vctrs_error_scalar_type")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.