Skip to content

Commit

Permalink
Use a non-equi join in set_dates_service()
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan committed Feb 27, 2023
1 parent ff3e5b4 commit e215f9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions R/dates.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ set_dates_services <- function(gtfs_obj) {
dplyr::filter(bool == 1) %>% dplyr::select(service_id, weekday, start_date, end_date)

# set services to dates according to weekdays and start/end date
date_service_df <-
suppress_matches_multiple_warning(
dplyr::full_join(dates, service_ids_weekdays, by="weekday")
date_service_df <- dates %>%
dplyr::inner_join(
service_ids_weekdays,
by = dplyr::join_by(weekday, between(date, start_date, end_date))
) %>%
dplyr::filter(date >= start_date & date <= end_date) %>%
dplyr::select(-weekday, -start_date, -end_date)

# addtions and exceptions
Expand Down
3 changes: 2 additions & 1 deletion R/globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ if (getRversion() >= "3.1.0") {
"start_time",
"end_time",
"feed_start_date",
"feed_end_date"
"feed_end_date",
"between"
)
)
}

0 comments on commit e215f9c

Please sign in to comment.