rywhale / kiwisR

Provides a simplified method for bringing tidy data into R from KISTERS WISKI databases via KiWIS API.
Other
12 stars 2 forks source link

Switch to using `inherits(x, "foo")` #11

Closed rywhale closed 4 years ago

rywhale commented 4 years ago

Description

Issues with some of the checks in r-devel. Output from CRAN tests for r-devel-linux-x86_64-debian-clang

checking tests ... [4s/9s] ERROR
  Running 'testthat.R' [4s/8s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(kiwisR)
  >
  > test_check("kiwisR")
   ----------- FAILURE REPORT --------------
   --- failure: the condition has length > 1 ---
   --- srcref ---
  :
   --- package (from environment) ---
  kiwisR
   --- call from context ---
  ki_station_list(hub = example_hub)
   --- call from argument ---
  if (class(json_content) == "character") {
      return("No matches for search term.")
  }

Apparently related to changes coming in R 4.0. Per this CRAN article:

Instead of class(x) == "foo", you should use inherits(x, "foo") or maybe alternatively is(x, "foo")

To Do