Skip to content

drop the quickPlot dependency - #57

Merged
achubaty merged 2 commits into
developmentfrom
issue-54-drop-quickPlot
Aug 10, 2026
Merged

drop the quickPlot dependency#57
achubaty merged 2 commits into
developmentfrom
issue-54-drop-quickPlot

Conversation

@achubaty

@achubaty achubaty commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Closes #54.

quickPlot is being archived on CRAN and is no longer maintained. It was in Imports, so its archival would have taken NetLogoR with it. This removes it from DESCRIPTION entirely — nothing in R/, tests/, vignettes/ or inst/ references it any more.

What was actually coupled

NetLogoR only ever borrowed four generics and exported its own methods for them:

Generic Was
coordinates setGeneric("coordinates", quickPlot::coordinates)
extent setGeneric("extent", quickPlot::extent)
layerNames setGeneric("layerNames", quickPlot::layerNames)
numLayers S3 methods registered on quickPlot's generic

These are now defined in NetLogoR with the same signatures, so calling code is unaffected. bbox() already worked this way, so there was a template in-tree.

The only piece that genuinely needed quickPlot was .identifyGrobToPlot(), which dispatches on quickPlot's internal .quickPlotGrob class so Plot() could draw a worldArray.

Why Plot() support could not be kept

quickPlot::Plot() dispatches on quickPlot's generics. Once the generics move into NetLogoR, keeping Plot() working means registering the methods against both sets — which puts two S4 method tables in the namespace and emits, at R CMD INSTALL and on every library(NetLogoR) for anyone with quickPlot installed:

Warning: multiple methods tables found for 'layerNames'
Warning: multiple methods tables found for 'extent'
Warning: multiple methods tables found for 'coordinates'

Verified causally by removing the dual registrations one at a time: 3 warnings with them, 0 without. Without the dual registration Plot() fails for all three classes (worldMatrix, worldArray, agentMatrix) at the extent dispatch, so the hook was unreachable dead code.

Plot() on NetLogoR objects therefore no longer works. plot() and points(), which draw through terra, are the replacement. Note this means no deprecation warning ships — there is no code path left to warn from, so quickPlot::Plot(w1) now surfaces quickPlot's own "unable to find an inherited method" error. The NEWS.md entry carries the explanation.

Also in here

  • R/quickPlot.RR/layers.R, since what remains is just the layer accessors.
  • world2spatRast() passed nrow=/ncol= to terra::rast(), which partial-matched and warned on every plot of a world. Corrected to nrows=/ncols= — this clears 7 warnings that were present in every test run.
  • test-plotting.R rewritten against plot()/points(); vignette prose updated in both .Rmds; all four shipped examples updated, including the SpaDES module's reqdPkgs.

Verification

  • R CMD check --as-cran: 0 errors, 0 warnings, 0 notes
  • devtools::test(): 0 failures (and down from 8 warnings to 1, itself pre-existing and unrelated)
  • _R_CHECK_DEPENDS_ONLY_=true check: passes
  • Smoke-tested against a real install with quickPlot not loaded: plot(), points(), numLayers(), layerNames(), extent() and coordinates() all behave, with zero "multiple methods tables" warnings

CI

All three workflows stop requesting PredictiveEcology/quickPlot@development in extra-packages, since nothing in the package references it any more. It can still arrive transitively as a dependency of the SpaDES packages; it is simply no longer something NetLogoR asks for.

🤖 Generated with Claude Code

achubaty and others added 2 commits August 10, 2026 11:51
quickPlot is being archived on CRAN and is no longer maintained, so it
would take NetLogoR down with it (#54). NetLogoR only ever borrowed four
generics from it -- coordinates(), extent(), layerNames() and numLayers()
-- and exported its own methods for them, so those are now defined here.
Their signatures are unchanged, so calling code is unaffected.

The one thing that genuinely needed quickPlot was .identifyGrobToPlot(),
which dispatches on quickPlot's own .quickPlotGrob class and let Plot()
draw a worldArray. Keeping Plot() working is not possible once the
generics move: Plot() dispatches on *quickPlot's* generics, so the
methods would have to be registered against both sets, which lands two
S4 method tables in the namespace and emits "multiple methods tables
found" for extent, coordinates and layerNames at install and on load.
Plot() therefore no longer works on NetLogoR objects; plot() and
points(), which draw through terra, are the replacement, and the
vignettes, the shipped examples and the plotting tests now use them.

Rename R/quickPlot.R to R/layers.R, since what is left of it is just the
layer accessors.

Also pass nrows/ncols rather than nrow/ncol to terra::rast() in
world2spatRast(), which was partial-matching and warning on every plot of
a world.

Closes #54

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nothing in the package references quickPlot any more, so it no longer
needs to be requested explicitly in extra-packages. It can still arrive
transitively as a dependency of the SpaDES packages, which is fine; it
is simply no longer something NetLogoR asks for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@achubaty
achubaty merged commit bd1ba60 into development Aug 10, 2026
14 checks passed
@achubaty
achubaty deleted the issue-54-drop-quickPlot branch August 10, 2026 18:25
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