diff --git a/DESCRIPTION b/DESCRIPTION index 970fb85..f0a408b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,21 +1,21 @@ Package: mobdb Type: Package -Title: Access the Mobility Database API to Discover Transit Feeds -Version: 1.0.0 +Title: Access the 'Mobility Database' API to Discover Transit Feeds +Version: 1.0.1 Authors@R: person("Jason", "Adle", , "developer@jasonadle.dev", role = c("aut", "cre", "cph")) Description: Search and access transit feed data from the - Mobility Database . The package wraps the 'Mobility Database' - API, allowing users to discover GTFS (General Transit Feed Specification) and - GBFS (General Bikeshare Feed Specification) feeds from agencies worldwide. - Functions are designed to integrate seamlessly with + 'Mobility Database' . The package wraps the 'Mobility Database' + API, allowing users to discover 'GTFS' (General Transit Feed Specification) and + 'GBFS' (General Bikeshare Feed Specification) feeds from agencies worldwide. + Functions are designed to integrate seamlessly with packages like 'tidytransit' and 'gtfstools' for subsequent feed analysis. URL: https://mobdb.jasonadle.dev, https://github.com/jasonad123/mobdb BugReports: https://github.com/jasonad123/mobdb/issues License: MIT + file LICENSE Encoding: UTF-8 Roxygen: list(markdown = TRUE) -Depends: +Depends: R (>= 4.1.0) Imports: curl, diff --git a/NEWS.md b/NEWS.md index 5561aae..616c9dc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# mobdb 1.0.1 + +## Bug fixes + +* Quoted certain software/API items in in the package description per CRAN +* Added documentation to `mobdb_cache_clear()` +* Replaced remaining `if(FALSE)`-disabled examples with `\dontrun{}` or runnable equivalents + # mobdb 1.0.0 Setting the stage for an initial CRAN release and bugfixes. @@ -71,7 +79,7 @@ None. ## Minor changes -* **New!** Vignette: "Working with GTFS-Realtime and GBFS" +* **New!** Vignette: "Working with GTFS-Realtime and GBFS" * `feeds_bbox()` supports both numeric vectors and sf bbox objects * Added `sf` to Suggests for bbox object support @@ -142,4 +150,4 @@ Initial release. Provides R access to the Mobility Database Catalog API for disc * Search and filter feeds with `mobdb_feeds()` * Access historical datasets with `mobdb_datasets()` * Direct integration with tidytransit via `mobdb_read_gtfs()` -* Secure authentication with `mobdb_set_key()` \ No newline at end of file +* Secure authentication with `mobdb_set_key()` diff --git a/R/cache.R b/R/cache.R index cae35dc..3659916 100644 --- a/R/cache.R +++ b/R/cache.R @@ -150,9 +150,11 @@ get_cache_ttl <- function(endpoint_type = c("feeds", "search", "datasets", "hist #' # Set for current session only #' mobdb_cache_path("~/my_mobdb_cache") #' } -#' @examplesIf FALSE +#' +#' \dontrun{ #' # Set permanently in .Renviron #' mobdb_cache_path("~/my_mobdb_cache", install = TRUE) +#' } mobdb_cache_path <- function(path = NULL, install = FALSE, overwrite = FALSE) { # If no path provided, just show current path @@ -325,7 +327,7 @@ mobdb_cache_list <- function() { #' @param older_than Optional. Remove only files older than this many days. #' If NULL (default), removes all cached files. #' -#' @return NULL +#' @return Invisibly returns NULL. Called for its side effect of removing cached files (and, if requested via older_than, only those older than the given number of days) #' @export #' #' @examples diff --git a/R/integration-tidytransit.R b/R/integration-tidytransit.R index f24b493..c14782c 100644 --- a/R/integration-tidytransit.R +++ b/R/integration-tidytransit.R @@ -167,17 +167,16 @@ mobdb_read_gtfs <- function(feed_id, dataset_id = NULL, ...) { #' # Download a specific historical version (feed_id auto-extracted from dataset_id) #' historical <- download_feed(dataset_id = "mdb-53-202507240047") #' -#' @examplesIf FALSE -#' # Filter by location (may return multiple feeds requiring disambiguation) -#' gtfs <- download_feed( +#' # Filter by location (may return multiple feeds requiring disambiguation, +#' # in which case refine with `provider` or `feed_name`) +#' try(download_feed( #' country_code = "US", #' subdivision_name = "California", #' municipality = "San Francisco" -#' ) +#' )) #' #' # Save GTFS feed to disk (raw file, no parsing required) -#' path <- download_feed("mdb-247", export_path = "data/gtfs/trimet.zip") -#' +#' path <- download_feed("mdb-247", export_path = tempfile(fileext = ".zip")) #' #' @seealso #' [mobdb_datasets()] to list all available historical versions, diff --git a/R/utils-auth.R b/R/utils-auth.R index f55f172..114e8d5 100644 --- a/R/utils-auth.R +++ b/R/utils-auth.R @@ -17,9 +17,11 @@ #' # Set token for current session #' mobdb_set_key("your_refresh_token_here") #' } -#' @examplesIf FALSE +#' +#' \dontrun{ #' # Set token permanently in .Renviron #' mobdb_set_key("your_refresh_token_here", install = TRUE) +#' } #' @concept authentication #' @export mobdb_set_key <- function(refresh_token, install = FALSE) { diff --git a/cran-comments.md b/cran-comments.md index f2cebb2..c14a54b 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -4,6 +4,17 @@ * This is a new release. +## Resubmission + +This is a resubmission addressing CRAN feedback from the initial submission: + +* Quoted `'Mobility Database'`, `'GTFS'` and `'GBFS'` in the `Description` field. +* Added a `\value` tag to `mobdb_cache_clear()`. +* Removed the remaining `if(FALSE)`-style disabled examples + (`mobdb_cache_path()`, `mobdb_set_key()`, `download_feed()`), replacing them + with `\dontrun{}` where the example writes permanently to `.Renviron`, or + folding them into an existing runnable `@examplesIf` block otherwise. + ## Test environments * Local: macOS 15.7.7, R 4.6.1 @@ -28,4 +39,4 @@ `gtfs_to_spec_format()`), since `@examplesIf mobdb_can_run_examples()` allows those examples to execute live API calls in that environment. On CRAN's build servers, no API key is configured, so these examples are - skipped entirely and this NOTE will not occur. \ No newline at end of file + skipped entirely and this NOTE will not occur. diff --git a/man/download_feed.Rd b/man/download_feed.Rd index 9cb1d26..0d69899 100644 --- a/man/download_feed.Rd +++ b/man/download_feed.Rd @@ -132,18 +132,17 @@ versions <- download_feed("mdb-2862", latest = FALSE) # Download a specific historical version (feed_id auto-extracted from dataset_id) historical <- download_feed(dataset_id = "mdb-53-202507240047") -\dontshow{\}) # examplesIf} -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} -# Filter by location (may return multiple feeds requiring disambiguation) -gtfs <- download_feed( + +# Filter by location (may return multiple feeds requiring disambiguation, +# in which case refine with `provider` or `feed_name`) +try(download_feed( country_code = "US", subdivision_name = "California", municipality = "San Francisco" -) +)) # Save GTFS feed to disk (raw file, no parsing required) -path <- download_feed("mdb-247", export_path = "data/gtfs/trimet.zip") - +path <- download_feed("mdb-247", export_path = tempfile(fileext = ".zip")) \dontshow{\}) # examplesIf} } \seealso{ diff --git a/man/mobdb-package.Rd b/man/mobdb-package.Rd index c19c65f..0cbf29f 100644 --- a/man/mobdb-package.Rd +++ b/man/mobdb-package.Rd @@ -4,11 +4,11 @@ \name{mobdb-package} \alias{mobdb} \alias{mobdb-package} -\title{mobdb: Access the Mobility Database API to Discover Transit Feeds} +\title{mobdb: Access the 'Mobility Database' API to Discover Transit Feeds} \description{ \if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} -Search and access transit feed data from the Mobility Database \url{https://mobilitydatabase.org}. The package wraps the 'Mobility Database' API, allowing users to discover GTFS (General Transit Feed Specification) and GBFS (General Bikeshare Feed Specification) feeds from agencies worldwide. Functions are designed to integrate seamlessly with packages like 'tidytransit' and 'gtfstools' for subsequent feed analysis. +Search and access transit feed data from the 'Mobility Database' \url{https://mobilitydatabase.org}. The package wraps the 'Mobility Database' API, allowing users to discover 'GTFS' (General Transit Feed Specification) and 'GBFS' (General Bikeshare Feed Specification) feeds from agencies worldwide. Functions are designed to integrate seamlessly with packages like 'tidytransit' and 'gtfstools' for subsequent feed analysis. } \seealso{ Useful links: diff --git a/man/mobdb_cache_clear.Rd b/man/mobdb_cache_clear.Rd index 51c82ce..4e3790c 100644 --- a/man/mobdb_cache_clear.Rd +++ b/man/mobdb_cache_clear.Rd @@ -10,6 +10,9 @@ mobdb_cache_clear(older_than = NULL) \item{older_than}{Optional. Remove only files older than this many days. If NULL (default), removes all cached files.} } +\value{ +Invisibly returns NULL. Called for its side effect of removing cached files (and, if requested via older_than, only those older than the given number of days) +} \description{ Removes cached files from the cache directory. Can remove all files or only those older than a specified number of days. diff --git a/man/mobdb_cache_path.Rd b/man/mobdb_cache_path.Rd index a686f7f..df4d82d 100644 --- a/man/mobdb_cache_path.Rd +++ b/man/mobdb_cache_path.Rd @@ -31,8 +31,9 @@ mobdb_cache_path() # Set for current session only mobdb_cache_path("~/my_mobdb_cache") } -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} + +\dontrun{ # Set permanently in .Renviron mobdb_cache_path("~/my_mobdb_cache", install = TRUE) -\dontshow{\}) # examplesIf} +} } diff --git a/man/mobdb_set_key.Rd b/man/mobdb_set_key.Rd index 5101de8..2e3de9c 100644 --- a/man/mobdb_set_key.Rd +++ b/man/mobdb_set_key.Rd @@ -26,9 +26,10 @@ The refresh token is used to generate short-lived access tokens automatically. # Set token for current session mobdb_set_key("your_refresh_token_here") } -\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} + +\dontrun{ # Set token permanently in .Renviron mobdb_set_key("your_refresh_token_here", install = TRUE) -\dontshow{\}) # examplesIf} +} } \concept{authentication}