Learn R Programming

assertive (version 0.2-6)

assert_all_are_in_future: Is the input in the past/future?

Description

Checks to see if the input is a time in the past/future.

Usage

assert_all_are_in_future(x)

assert_any_are_in_future(x)

assert_all_are_in_past(x)

assert_any_are_in_past(x)

is_in_future(x)

is_in_past(x)

Arguments

x
Input to check.

Value

  • The is_* function return TRUE if the input is a time in the future/past. The assert_* functions return nothing but throw an error if the corresponding is_* function returns FALSE.

Details

The current time is determined by Sys.time, and the input is coerced to POSIXct format if necessary.

See Also

Sys.time.

Examples

Run this code
x <- Sys.time() + c(-1, 100)
is_in_past(x)
is_in_future(x)
assert_is_empty(NULL)
assert_is_empty(numeric())
assert_is_non_empty(1:10)
assert_is_non_empty(NA)
assert_is_scalar(1)
assert_is_scalar("Multiple words in a single string are scalar.")
assert_is_scalar(NA)

Run the code above in your browser using DataLab