date_in_range | R Documentation |
Test where a date falls relative to a date range
date_in_range(target, start, end, .before = FALSE, .ongoing = TRUE,
.during = TRUE, .after = FALSE)
target |
The date of interest |
start |
The starting date of the range |
end |
The ending date of the range |
.before |
The value to assign if the date falls before the range (default FALSE) |
.ongoing |
The value to assign if the date falls after start, and end is NA (default TRUE) |
.during |
The value to assign if the date falls within the range (default TRUE) |
.after |
The value to assign if the date falls after the range (default FALSE) |
The return values can be logical, character, or numeric. The interval for within includes the start and end dates.
The return type is determined by the user. The default is logical.
date_in_range(iso_to_posix("2018-03-14T12:34"), iso_to_posix("2018-03-11T12:34"), iso_to_posix("2018-03-18T12:34"))
date_in_range("2018-03-14", "2018-03", "2018-03-18T12:34")
date_in_range(iso_to_posix("2018-03-14T12:34"), iso_to_posix("2018-03-15T12:34"), iso_to_posix("2018-03-18T12:34"))
date_in_range(iso_to_posix("2018-03-14T12:34")+(1:10)*24*2600,
iso_to_posix("2018-03-11T12:34"),
iso_to_posix("2018-03-18T12:34"))
date_in_range(iso_to_posix("2018-03-09T12:34")+(1:10)*24*3600,
iso_to_posix("2018-03-11T12:34"),
c(rep(iso_to_posix("2018-03-15T12:34"),9), NA),
.before="BEFORE", .ongoing="ONGOING", .during="DURING", .after="AFTER")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.