Skip to content

Commit

Permalink
comment out lines breaking import with frequency calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
tbuckl committed Jan 30, 2019
1 parent f2f302d commit d844403
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions R/time.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#' @param stop_times_df a gtfsr$stop_times_df dataframe
#' @return an dataframe with arrival and departure time set to lubridate types
#' @keywords internal
#' @importFrom lubridate hms
gt_as_dt <- function(stop_times_df) {
stop("This method is deprecated, use set_hms_time on the feed instead")
}
Expand Down Expand Up @@ -43,10 +42,13 @@ set_hms_times <- function(gtfs_obj) {
gtfs_obj$stop_times_df$arrival_time_hms <- hms::hms(str_to_seconds(gtfs_obj$stop_times_df$arrival_time))
gtfs_obj$stop_times_df$departure_time_hms <- hms::hms(str_to_seconds(gtfs_obj$stop_times_df$departure_time))

if(!is.null(gtfs_obj$frequencies_df) & nrow(gtfs_obj$frequencies_df) > 0) {
gtfs_obj$frequencies_df$start_time_hms <- hms::hms(str_to_seconds(gtfs_obj$frequencies_df$start_time))
gtfs_obj$frequencies_df$end_time_hms <- hms::hms(str_to_seconds(gtfs_obj$frequencies_df$end_time))
}
# TODO: figure out where to put these lines.
# right now they are being called before the data frame it operates on exists
# also, i think we need an "exists" check for the frequencies_df rather than an !is.null
# if(!is.null(gtfs_obj$frequencies_df) & nrow(gtfs_obj$frequencies_df) > 0) {
# gtfs_obj$frequencies_df$start_time_hms <- hms::hms(str_to_seconds(gtfs_obj$frequencies_df$start_time))
# gtfs_obj$frequencies_df$end_time_hms <- hms::hms(str_to_seconds(gtfs_obj$frequencies_df$end_time))
# }

return(gtfs_obj)
}
Expand Down
1 change: 0 additions & 1 deletion vignettes/GTFS-table-relationships.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ tidytransit prints a message regarding these tables on reading any GTFS file.
# Read in GTFS feed
# here we use a feed included in the package, but note that you can read directly from the New York City Metropolitan Transit Authority using the following URL:
# nyc <- read_gtfs("http://web.mta.info/developers/data/nyct/subway/google_transit.zip")
local_gtfs_path <- system.file("extdata",
"google_transit_nyc_subway.zip",
package = "tidytransit")
Expand Down

0 comments on commit d844403

Please sign in to comment.