dimfalk / kostra2010R

R interface for KOSTRA-DWD-2010R dataset
GNU General Public License v3.0
2 stars 0 forks source link

best practice to load `*.rda` files from `/data/`? #36

Closed dimfalk closed 1 year ago

dimfalk commented 1 year ago

Currently devtools::check() and codecov(token = "xxx") fail because of this.

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-get_centroid.R:7'): Function working as intended. ──────────────
Error in `readChar(con, 5L, useBytes = TRUE)`: cannot open the connection
Backtrace:
    ▆
 1. ├─testthat::expect_equal(...) at test-get_centroid.R:7:2
 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. ├─sf::st_coordinates(get_centroid(input = "Aachen"))
 5. └─kostra2010R::get_centroid(input = "Aachen")
 6.   └─base::load(system.file("data/vg250_gem_centroids.rda", package = "kostra2010R"))
 7.     └─base::readChar(con, 5L, useBytes = TRUE)

devtools::test() works fine (locally).

dimfalk commented 1 year ago

https://github.com/falk-env/kostra2010R/blob/2e3fb4720fb20aa54299bd071ae4a6ac610335bf/tests/testthat/test-get_centroid.R#L7-L9

dimfalk commented 1 year ago

https://github.com/falk-env/kostra2010R/blob/2e3fb4720fb20aa54299bd071ae4a6ac610335bf/R/utils.R#L85-L113