Skip to content

Fix CRAN donttest issue #8

Description

@christophscheuch
* checking examples with --run-donttest ... [1s/33s] ERROR
Running examples in ‘econtools-Ex.R’ failed
The error most likely occurred in:

> ### Name: add_gdp_column
> ### Title: Add GDP to Country Data
> ### Aliases: add_gdp_column
> 
> ### ** Examples
> 
> ## Don't show: 
> if (curl::has_internet()) (if (getRversion() >= "3.4") withAutoprint else force)({ # examplesIf
+ ## End(Don't show)
+ ## No test: 
+ # Add most recent GDP values
+ df <- data.frame(country = c("USA", "CHN", "DEU"))
+ result <- add_gdp_column(df, id_column = "country")
+ 
+ # Add year-specific GDP values
+ df <- data.frame(country = c("USA", "CHN"), year = c(2019, 2020))
+ result <- add_gdp_column(df, id_column = "country", date_column = "year")
+ ## End(No test)
+ ## Don't show: 
+ }) # examplesIf
> df <- data.frame(country = c("USA", "CHN", "DEU"))
> result <- add_gdp_column(df, id_column = "country")
Error in `weo_get_latest_publication()`:
! No valid WEO publication found.
Backtrace:
     ▆
  1. ├─(if (getRversion() >= "3.4") withAutoprint else force)(...)
  2. │ └─base::source(...)
  3. │   ├─base::withVisible(eval(ei, envir))
  4. │   └─base::eval(ei, envir)
  5. │     └─base::eval(ei, envir)
  6. └─econtools::add_gdp_column(df, id_column = "country")
  7.   └─econtools:::add_generic_column(...)
  8.     ├─dplyr::rename(...)
  9.     └─econtools (local) data_fetcher(...)
 10.       ├─dplyr::mutate(...)
 11.       ├─dplyr::select(...)
 12.       ├─dplyr::filter(weo_get(entities, series), .data$series_id == series)
 13.       └─imfweo::weo_get(entities, series)
 14.         └─imfweo:::resolve_publication(year, release)
 15.           └─imfweo::weo_get_latest_publication()
 16.             └─cli::cli_abort("No valid WEO publication found.")
 17.               └─rlang::abort(...)
Execution halted
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘testthat.R’
 OK
* checking PDF version of manual ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* checking for new files in some other directories ... OK
* DONE

Status: 1 ERROR
See
  ‘/data/blackswan/ripley/R/packages/tests-devel/econtools.Rcheck/00check.log’
for details.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions