-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
There is already dob, date_stamp, and we could use these to get start and end dates, e.g.:
set.seed(1)
r_data_frame(
n = 5,
dob(name = "date_start")) %>%
mutate(date_end = date_start + runif(n(), 1, 100))
# # A tibble: 5 x 2
# date_start date_end
# <date> <date>
# 1 2007-04-20 2007-06-01
# 2 2007-03-23 2007-06-16
# 3 2008-06-06 2008-07-29
# 4 2007-02-21 2007-04-17
# 5 2008-05-08 2008-07-31Could we have a dedicated function that would create start and end date, where obviously date_end can't be before the date_start?
Or maybe even better, let date_stamp accept column name for start=, like below:
r_data_frame(
n = 5,
dob(name = "date_start")) %>%
mutate(date_end = date_stamp(start = date_start))
# Error in seq(start, length = k, by = by) : object 'date_start' not foundReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels