Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require(maps) in test #166

Merged
merged 4 commits into from
Nov 12, 2024
Merged

require(maps) in test #166

merged 4 commits into from
Nov 12, 2024

Conversation

tdhock
Copy link
Collaborator

@tdhock tdhock commented Nov 11, 2024

maps is missing on CRAN for some reason. https://cran.r-project.org/web/checks/check_results_animint2.html

Version: 2024.11.2
Check: examples
Result: ERROR
  Running examples in ‘animint2-Ex.R’ failed
  The error most likely occurred in:
  
  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: geom_segment
  > ### Title: Line segments and curves.
  > ### Aliases: geom_segment geom_curve
  > 
  > ### ** Examples
  > 
  > b <- ggplot(mtcars, aes(wt, mpg)) +
  +   geom_point()
  > 
  > df <- data.frame(x1 = 2.62, x2 = 3.57, y1 = 21.0, y2 = 15.0)
  > b +
  +  geom_curve(aes(x = x1, y = y1, xend = x2, yend = y2, colour = "curve"), data = df) +
  +  geom_segment(aes(x = x1, y = y1, xend = x2, yend = y2, colour = "segment"), data = df)
  > 
  > b + geom_curve(aes(x = x1, y = y1, xend = x2, yend = y2), data = df, curvature = -0.2)
  > b + geom_curve(aes(x = x1, y = y1, xend = x2, yend = y2), data = df, curvature = 1)
  > b + geom_curve(
  +   aes(x = x1, y = y1, xend = x2, yend = y2),
  +   data = df,
  +   arrow = arrow(length = unit(0.03, "npc"))
  + )
  > 
  > ggplot(seals, aes(long, lat)) +
  +   geom_segment(aes(xend = long + delta_long, yend = lat + delta_lat),
  +     arrow = arrow(length = unit(0.1,"cm"))) +
  +   borders("state")
  Error: Package `maps` required for `map_data`.
  Please install and try again.
  Execution halted
Flavor: [r-devel-linux-x86_64-debian-gcc](https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-gcc/animint2-00check.html)

Version: 2024.11.2
Check: tests
Result: ERROR
    Running ‘namespace.R’ [1s/2s]
    Running ‘testthat.R’ [33s/37s]
  Running the tests in ‘tests/testthat.R’ failed.
  Complete output:
    > library(testthat)
    > data.table::setDTthreads(1)
    > test_check("animint2", filter="compiler")
    Loading required package: animint2
    [1] "aesthetics"
    mapping: x = Sepal.Length, y = Petal.Length 
    geom_point: na.rm = FALSE
    stat_identity: na.rm = FALSE
    position_identity 
    $problem.aes
    [1] "foo"
    
    $data.variables
    [1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"  "Species"     
    
    [1] "animation"
    [1] "compiler errors"
    mapping: x = letter, y = count, fill = stack, key = key, showSelected1 = facet 
    geom_bar: width = NULL, na.rm = FALSE
    stat_identity: na.rm = FALSE
    position_stack 
    [1] "geom line"
    [1] "plot named timexxx"
    [1] "plot names"
    [1] "geom_point(aes(fill=numeric))"
    [1] "compiler print"
    [1] "pt/points to lines conversion test"
    [1] "save separate chunks"
    [1] "selectors"
    [1] "stat_summary"
    [1] "compiler errors"
    [1] "compiler unlink previous"
    [ FAIL 2 | WARN 0 | SKIP 0 | PASS 744 ]
    
    ══ Failed tests ════════════════════════════════════════════════════════════════
    ── Error ('test-compiler-animation.R:3:1'): (code run outside of `test_that()`) ──
    <packageNotFoundError/error/condition>
    Error in `library(maps)`: there is no package called 'maps'
    Backtrace:
        ▆
     1. └─base::library(maps) at test-compiler-animation.R:3:1
    ── Error ('test-compiler-coord-train.r:7:5'): NA's don't appear in breaks ──────
    <packageNotFoundError/error/condition>
    Error in `loadNamespace(x)`: there is no package called 'mapproj'
    Backtrace:
         ▆
      1. ├─testthat::expect_false(any_NA_major_minor(coord_map()$train(scales))) at test-compiler-coord-train.r:34:3
      2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
      3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
      4. ├─animint2 (local) any_NA_major_minor(coord_map()$train(scales))
      5. ├─coord_map()$train(scales) at test-compiler-coord-train.r:7:5
      6. │ └─animint2 (local) f(..., self = self)
      7. │   └─animint2:::mproject(self, grid$x, grid$y, orientation)
      8. │     └─base::suppressWarnings(...)
      9. │       └─base::withCallingHandlers(...)
     10. └─base::loadNamespace(x)
     11.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
     12.     └─base (local) withOneRestart(expr, restarts[[1L]])
     13.       └─base (local) doWithOneRestart(return(expr), restart)
    
    [ FAIL 2 | WARN 0 | SKIP 0 | PASS 744 ]
    Error: Test failures
    Execution halted
Flavor: [r-devel-linux-x86_64-debian-gcc](https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-gcc/animint2-00check.html)

maps is used in Suggests, so we are supposed to use it conditionally, so this PR fixes that.

@tdhock tdhock merged commit d7e9d9a into master Nov 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant