feat: add tinyplot.array() method - #746
Merged
Merged
Conversation
Add a tinyplot.array() method for arrays with up to four dimensions. The first two dimensions follow the tinyplot.matrix() conventions; the third maps to a facet wrap and a fourth to a facet grid. The matrix method is refactored onto a shared internal array_plot() helper. Also fix two related bugs: - Drop degenerate dimensions (1-row/1-column arrays) in sanitize_datapoints(), so tinyplot(1:10, array(1:10, c(1, 10))) works like plot(). - Forward `data` to sanitize_facet(), so two-sided facet formulas work with the default method. Previously `data` resolved to utils::data. Closes #548
grantmcdermott
added a commit
that referenced
this pull request
Sep 27, 2026
Clears the R CMD check NOTE about an undefined global function, introduced with tinyplot.array() in #746.
grantmcdermott
added a commit
that referenced
this pull request
Sep 28, 2026
* chore: prepare v0.8.0 CRAN release Bump version to 0.8.0, rename the NEWS development heading, and update cran-comments.md for this release. The revdep section is a placeholder until the revdep-v0.8.0 workflow finishes. * docs: add v0.8.0 revdep results to cran-comments * chore: exclude tests from CRAN tarball * fix: namespace utils::type.convert in array_plot Clears the R CMD check NOTE about an undefined global function, introduced with tinyplot.array() in #746. * submission note and revert rbuildignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #548.
Summary
tinyplot.array()method for (unclassed) arrays with up to 4 dimensions:tinyplot.matrix()names(dimnames(x)), if present, supply axis/legend/facet titles (works withfacet.args = list(prefix = TRUE))"tile"/"heatmap"types lay out each 2D slice as a grid, as for matricestinyplot.matrix()is refactored onto a shared internalarray_plot()helper. Existing matrix snapshots are unchanged.sanitize_datapoints(), sotinyplot(1:10, array(1:10, c(1, 10)))now works likeplot().tinyplot(x, y, facet = a ~ b, data = dat)) errored becausedatawas never stored insettings, sosanitize_facet()resolved it toutils::data. This also removes deadfacet.argscode in that branch, since the grid layout is read from thefacet_gridattribute downstream.Notes
"table"objects (HairEyeColor,Titanic, ...) don't dispatch here because of their class attribute. Per the discussion in Incompatible with arrays #548, contingency tables probably want different defaults (barplot/spineplot) and a separatetinyplot.table()method.ypassed to the default method (e.g.tinyplot(x, Y)) is still out of scope.Tests
New
inst/tinytest/test-array.R(6 snapshots + error checks). Full suite passes locally on Linux: 832 results OK.