A function to generate test data for RBC for toy examples.
setup_random_test_data(num_people = 10, initial_date = "2001-01-01", numJourneys = 5, min = 0, max = 10)
num_people | The number of person instances. |
---|---|
initial_date | The start crossing date. |
numJourneys | The number of journeys for each person. |
min | The minimum duration between journeys. |
max | The maximum duration between journeys. |
A data frame object
res <- setup_random_test_data(10, initial_date = '2001-01-01', numJourneys = 5, min = 0, max = 10) head(res)#> journeyId personId is_arrival date_crossing journey_sequence #> 1 1 1 1 2001-01-01 1 #> 2 2 1 0 2001-01-03 2 #> 3 3 1 1 2001-01-06 3 #> 4 4 1 0 2001-01-12 4 #> 5 5 1 1 2001-01-21 5 #> 6 1 2 1 2001-01-01 1 #> res_status_before res_status_after journeyId_prev #> 1 0 0 0 #> 2 0 0 0 #> 3 0 0 0 #> 4 0 0 0 #> 5 0 0 0 #> 6 0 0 0