Skip to content

Commit 820398b

Browse files
committed
add \dontrun{} to examples to pass Debian CRAN check
1 parent d43a7cc commit 820398b

File tree

9 files changed

+51
-22
lines changed

9 files changed

+51
-22
lines changed

R/dates.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ convert_dates <- function(gtfs_obj, parse_function = parse_gtfsio_date) {
4242
#'
4343
#' @keywords internal
4444
#' @importFrom stats reshape
45-
#' @examples
46-
#' library(dplyr)
47-
#' local_gtfs_path <- system.file("extdata", "google_transit_nyc_subway.zip", package = "tidytransit")
48-
#' nyc <- read_gtfs(local_gtfs_path)
49-
#' nyc_services_by_date <- nyc$.$dates_services
50-
#' # count the number of services running on each date
51-
#' nyc_services_by_date %>% group_by(date) %>% count()
5245
set_dates_services <- function(gtfs_obj) {
5346
has_calendar = feed_contains(gtfs_obj, "calendar") && nrow(gtfs_obj[["calendar"]]) > 0
5447
has_calendar_dates = feed_contains(gtfs_obj, "calendar_dates") && nrow(gtfs_obj[["calendar_dates"]]) > 0

R/geo.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#' among all stops for large feeds should be avoided
1111
#'
1212
#' @examples
13+
#' \dontrun{
1314
#' library(dplyr)
1415
#'
1516
#' nyc_path <- system.file("extdata", "google_transit_nyc_subway.zip", package = "tidytransit")
@@ -34,7 +35,7 @@
3435
#' #> 9 423S 232S 91.5
3536
#' #> 10 232 423 91.5
3637
#' #> # … with 26 more rows
37-
#'
38+
#' }
3839
#' @export
3940
stop_distances = function(gtfs_stops) {
4041
stopifnot(nrow(gtfs_stops) > 1)
@@ -98,7 +99,8 @@ prep_dist_mtrx = function(dist_list) {
9899
#' number of stop ids within that group (n_stop_ids) and distance summary values
99100
#' (dist_mean, dist_median and dist_max).
100101
#'
101-
#' @examples
102+
#' @examples
103+
#' \dontrun{
102104
#' library(dplyr)
103105
#'
104106
#' nyc_path <- system.file("extdata", "google_transit_nyc_subway.zip", package = "tidytransit")
@@ -119,7 +121,7 @@ prep_dist_mtrx = function(dist_list) {
119121
#' #> 9 7 Av <dbl [9 × 9]> 9 5479. 5479. 10753.
120122
#' #> 10 111 St <dbl [9 × 9]> 9 3877. 3877. 7753.
121123
#' #> # … with 370 more rows
122-
#'
124+
#' }
123125
#' @export
124126
stop_group_distances = function(gtfs_stops, by = "stop_name") {
125127
distances <- n_stop_ids <- dist_mean <- dist_median <- dist_max <- NULL

R/time.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ replace_NA_times = function(stop_times) {
106106
#' are interpolated equally between stops.
107107
#' @return tidygtfs or stop_times with interpolated arrival and departure times
108108
#' @examples
109+
#' \dontrun{
109110
#' data(gtfs_duke)
110111
#' print(gtfs_duke$stop_times[1:5, 1:5])
111112
#'
@@ -114,6 +115,7 @@ replace_NA_times = function(stop_times) {
114115
#'
115116
#' gtfs_duke_3 = interpolate_stop_times(gtfs_duke, FALSE)
116117
#' print(gtfs_duke_3$stop_times[1:5, 1:5])
118+
#' }
117119
#' @export
118120
interpolate_stop_times = function(x, use_shape_dist = TRUE) {
119121
....event_time <- ....shape_dist_traveled <- NULL

R/validate_gtfs.R

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@
4242
#' }
4343
#'
4444
#' @examples
45+
#' validate_gtfs(gtfs_duke)
46+
#' #> # A tibble: 233 × 8
47+
#' #> file file_spec file_provided_status field field_spec field_provided_status
48+
#' #> <chr> <chr> <lgl> <chr> <chr> <lgl>
49+
#' #> 1 agency req TRUE agenc… opt TRUE
50+
#' #> 2 agency req TRUE agenc… req TRUE
51+
#' #> 3 agency req TRUE agenc… req TRUE
52+
#' #> 4 agency req TRUE agenc… req TRUE
53+
#' #> 5 agency req TRUE agenc… opt TRUE
54+
#' #> 6 agency req TRUE agenc… opt TRUE
55+
#' #> 7 agency req TRUE agenc… opt TRUE
56+
#' #> 8 agency req TRUE agenc… opt FALSE
57+
#' #> 9 stops req TRUE stop_… req TRUE
58+
#' #> 10 stops req TRUE stop_… opt TRUE
59+
#' #> # 223 more rows
60+
#' #> # 2 more variables: validation_status <chr>, validation_details <chr>
61+
#'
62+
#' \dontrun{
4563
#' local_gtfs_path <- system.file("extdata", "google_transit_nyc_subway.zip", package = "tidytransit")
4664
#' gtfs <- read_gtfs(local_gtfs_path)
4765
#' attr(gtfs, "validation_result")
@@ -52,7 +70,7 @@
5270
#' # should raise a warning
5371
#' gtfs$stop_times <- NULL
5472
#' validation_result <- validate_gtfs(gtfs)
55-
#'
73+
#' }
5674
#' @export
5775
validate_gtfs <- function(gtfs_obj, files = NULL, warnings = TRUE) {
5876

man/interpolate_stop_times.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/set_dates_services.Rd

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/stop_distances.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/stop_group_distances.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/validate_gtfs.Rd

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)