Skip to content

Commit

Permalink
Merge pull request #118 from rOpenSpain/fix-examples-for-r-cmd-check
Browse files Browse the repository at this point in the history
PR to test if R CMD check is happy when data downloading examples are conditional on interactive session
  • Loading branch information
e-kotov authored Dec 17, 2024
2 parents a8612d7 + 459d230 commit cf5bcd9
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual", "--compact-vignettes=gs+qpdf", "--no-examples")'
build_args: 'c("--no-manual", "--compact-vignettes=gs+qpdf")'
2 changes: 1 addition & 1 deletion R/available-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' \item{downloaded}{\code{logical}. Indicator of whether the data file has been downloaded locally. This is only available if `check_local_files` is `TRUE`.}
#' }
#' @export
#' @examples
#' @examplesIf interactive()
#' \donttest{
#'
#' # Set data dir for file downloads
Expand Down
2 changes: 1 addition & 1 deletion R/connect.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @export
#' @return a `DuckDB` table connection object.
#'
#' @examples
#' @examplesIf interactive()
#' \donttest{
#' # Set data dir for file downloads
#' spod_set_data_dir(tempdir())
Expand Down
2 changes: 1 addition & 1 deletion R/convert.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' @return Path to saved `DuckDB` database file or to a folder with `parquet` files in hive-style directory structure.
#' @export
#'
#' @examples
#' @examplesIf interactive()
#' \donttest{
#' # Set data dir for file downloads
#' spod_set_data_dir(tempdir())
Expand Down
1 change: 1 addition & 0 deletions R/data-dir.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ spod_set_data_dir <- function(
#' @return A `character` vector of length 1 containing the path to the data directory where the package will download and convert the data.
#' @export
#' @examples
#' spod_set_data_dir(tempdir())
#' spod_get_data_dir()
#'
spod_get_data_dir <- function(quiet = FALSE) {
Expand Down
2 changes: 1 addition & 1 deletion R/disconnect.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param free_mem A `logical`. Whether to free up memory by running `gc()`. Defaults to `TRUE`.
#' @return No return value, called for side effect of disconnecting from the database and freeing up memory.
#' @export
#' @examples
#' @examplesIf interactive()
#' \donttest{
#' # Set data dir for file downloads
#' spod_set_data_dir(tempdir())
Expand Down
2 changes: 1 addition & 1 deletion R/download_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @return Nothing. If `return_local_file_paths = TRUE`, a `character` vector of the paths to the downloaded files.
#'
#' @export
#' @examples
#' @examplesIf interactive()
#' \donttest{
#'
#' # Set data dir for file downloads
Expand Down
2 changes: 1 addition & 1 deletion R/get-zones.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#' }
#'
#' @export
#' @examples
#' @examplesIf interactive()
#' \donttest{
#' # get polygons for municipalities for the v2 data
#' municip_v2 <- spod_get_zones(zones = "municipalities", ver = 2)
Expand Down
2 changes: 1 addition & 1 deletion R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @inheritParams global_quiet_param
#' @return A DuckDB lazy table connection object of class `tbl_duckdb_connection`.
#' @export
#' @examples
#' @examplesIf interactive()
#' \donttest{
#'
#' # create a connection to the v1 data
Expand Down
2 changes: 1 addition & 1 deletion R/internal-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ spod_expand_dates_from_regex <- function(date_regex) {
#' @inheritParams spod_available_data
#' @return A vector of type `Date` with all possible valid dates for the specified data version (v1 for 2020-2021 and v2 for 2020 onwards).
#' @export
#' @examples
#' @examplesIf interactive()
#' \donttest{
#' # Get all valid dates for v1 (2020-2021) data
#' spod_get_valid_dates(ver = 1)
Expand Down
2 changes: 1 addition & 1 deletion R/quick-get.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
#' @export
#'
#' @examples
#' @examplesIf interactive()
#' \donttest{
#' od_1000 <- spod_quick_get_od(
#' date = "2022-01-01",
Expand Down
3 changes: 2 additions & 1 deletion man/spod_available_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/spod_connect.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/spod_convert.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/spod_disconnect.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/spod_download.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/spod_get.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/spod_get_data_dir.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/spod_get_valid_dates.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/spod_get_zones.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/spod_quick_get_od.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cf5bcd9

Please sign in to comment.